/* Imprato — panel y portal
   Identidad: papel, tinta y registro CMYK. Una sola tipografía (Archivo) con ancho variable. */

:root {
	--brand: #0e7490;
	--paper: #f4f6f8;
	--surface: #ffffff;
	--ink: #1b1e28;
	--ink-2: #3a4050;
	--muted: #6b7180;
	--line: #e3e6ec;
	--line-2: #d3d8e0;
	--soft: #eef1f5;
	--ok: #15803d;
	--warn: #b45309;
	--bad: #c2410c;
	--c: #00aeef; --m: #ec008c; --y: #ffe600; --k: #23272f;
	--r-lg: 12px; --r: 8px; --r-sm: 6px;
	--shadow: 0 1px 0 rgba(27,30,40,.04), 0 6px 24px -12px rgba(27,30,40,.18);
	--side: clamp(216px, 18vw, 248px);
	--font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--brand-ink: color-mix(in srgb, var(--brand) 82%, #000);
	--brand-tint: color-mix(in srgb, var(--brand) 10%, #fff);
	color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	font-variation-settings: "wdth" 100;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-stretch: 87%; font-variation-settings: "wdth" 87; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 750; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .8em; }
.num, .money, td.r, .kpi b { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.customer-import-form { display: grid; gap: 16px; }
.customer-import-form details summary { margin-bottom: 12px; cursor: pointer; }
.customer-import-form .field, .customer-import-form select { min-width: 0; }
.customer-import-form input[type=file] { width: 100%; max-width: 100%; }
.customer-import-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
#customer-import-preview .sub { white-space: normal; overflow: visible; text-overflow: clip; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Firma: registro CMYK y marcas de corte */
.reg { display: flex; height: 4px; border-radius: 2px; overflow: hidden; }
.reg i { flex: 1; } .reg i:nth-child(1){background:var(--c)} .reg i:nth-child(2){background:var(--m)} .reg i:nth-child(3){background:var(--y)} .reg i:nth-child(4){background:var(--k)}
.crop { position: relative; }
.crop::before, .crop::after, .crop > .crop-b::before, .crop > .crop-b::after {
	content: ""; position: absolute; width: 18px; height: 18px; border-color: var(--ink); opacity: .55; pointer-events: none;
}
.crop::before { top: -10px; left: -10px; border-top: 1px solid; border-left: 1px solid; }
.crop::after { top: -10px; right: -10px; border-top: 1px solid; border-right: 1px solid; }
.crop > .crop-b::before { bottom: -10px; left: -10px; border-bottom: 1px solid; border-left: 1px solid; }
.crop > .crop-b::after { bottom: -10px; right: -10px; border-bottom: 1px solid; border-right: 1px solid; }

/* ---------- Boot */
.ep-boot { min-height: 100vh; display: grid; place-items: center; }
.ep-spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout del panel */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
	position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--ink); color: #c9cdd6;
	display: flex; flex-direction: column; padding: 16px 14px; gap: 14px; z-index: 30;
}
.side-head { display: flex; align-items: center; gap: 4px; }
.drawer-shade, .side .drawer-close { display: none; }
.brand-id {
	--identity-text: #f6f8fc;
	--identity-muted: #b4bfce;
	--identity-line: rgba(186,202,225,.19);
	--identity-control: rgba(255,255,255,.05);
	--identity-hover: rgba(255,255,255,.12);
	min-width: 0; overflow: hidden; color: var(--identity-text);
	border: 1px solid var(--identity-line); border-radius: 12px;
	background: #242a36;
	background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 13%, #272e3b), #202530 88%);
	box-shadow: 0 10px 22px -17px rgba(0,0,0,.7);
}
.brand-id[data-presentation="light"] {
	--identity-text: #192438;
	--identity-muted: #516076;
	--identity-line: #dfe5ed;
	--identity-control: #fff;
	--identity-hover: #e9eef4;
	background: #fff;
}
.side .brand-id { flex: 1; }
.brand-id-canvas { display: flex; align-items: center; min-height: 52px; padding: 7px 11px; }
.brand-id[data-presentation="light"] .brand-id-canvas { padding-inline-start: 4px; }
.brand-id-logo { display: block; max-width: min(100%, 148px); min-width: 0; }
.brand-id-logo.light { padding: 4px 7px; }
.brand-id-logo img { display: block; width: auto; max-width: 100%; height: auto; max-height: 30px; object-fit: contain; }
.brand-id-caption { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 10px 11px; }
.brand-id-canvas + .brand-id-caption { border-top: 1px solid var(--identity-line); }
.brand-id[data-presentation="light"] .brand-id-caption { background: #f5f7fa; background: color-mix(in srgb, var(--brand) 4%, #f7f8fb); }
.brand-id-mark { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 8px; background: #343d50; background: color-mix(in srgb, var(--brand) 34%, var(--ink)); font-weight: 800; }
.brand-id-name { flex: 1; min-width: 0; }
.brand-id-name b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 14px; line-height: 1.22; }
.brand-id-signature { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--identity-muted); }
.brand-id-signature .reg { flex: 0 0 20px; height: 3px; gap: 1px; }
.brand-id-signature small { font-size: 11px; line-height: 1.25; }
.brand-id-edit { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--identity-line); border-radius: 8px; background: var(--identity-control); color: var(--identity-muted); }
.brand-id-edit:hover, .brand-id-edit:focus-visible { background: var(--identity-hover); color: var(--identity-text); }
.brand-id-edit svg { width: 15px; height: 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
	display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r);
	color: #c9cdd6; font-weight: 500; font-size: 14.5px;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav .count { margin-left: auto; background: var(--m); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 6px 8px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.side .me .avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.side .me b { display: block; color: #fff; font-size: 13.5px; }
.side .me span { font-size: 12px; color: #8f95a3; }
.side .me button { margin-left: auto; background: none; border: 0; color: #8f95a3; cursor: pointer; padding: 6px; border-radius: 6px; }
.side .me button:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
	position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
	padding: 12px 28px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.top .burger { display: none; }
.top .search { flex: 1; max-width: 420px; position: relative; }
.top .search input { padding-left: 36px; background: var(--surface); }
.top .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); }
.top .spacer { flex: 1; }
.page { padding: 26px 28px 60px; max-width: 1380px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.demo-band { background: var(--ink); color: #fff; font-size: 13px; padding: 7px 28px; display: flex; gap: 10px; align-items: center; }
.demo-band .reg { width: 46px; }
.demo-band button { margin-left: auto; }
.portal-preview .row { margin-left: auto; gap: 6px; }

/* ---------- Botones e inputs */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 14px;
	padding: 9px 15px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
	cursor: pointer; white-space: nowrap; line-height: 1.2; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--soft); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.dark.ghost, .demo-band .btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }

.identity-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,250px); align-items: start; gap: 22px; }
.identity-grid h2 { margin: 0 0 4px; }
.identity-grid p { margin: 0 0 14px; }
.identity-preview { min-width: 0; padding: 14px; border-radius: 12px; background: var(--ink); }
.identity-preview > span { display: block; margin-bottom: 10px; color: #afb5c3; font-size: 12px; }
.identity-form .field { margin-bottom: 10px; }
.identity-form .row { flex-wrap: wrap; }
.identity-modes { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.identity-modes legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 750; }
.identity-mode { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.identity-mode:has(:checked) { border-color: var(--brand); background: var(--brand-tint); }
.identity-mode input { flex: none; margin: 3px 0 0; accent-color: var(--brand); }
.identity-mode strong, .identity-mode small { display: block; }
.identity-mode small { color: var(--muted); font-size: 12px; font-weight: 400; }
.identity-form h3 { margin: 0 0 8px; font-size: 14px; }
.identity-file { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.identity-file input { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
.identity-file .btn { margin: 0; }
.identity-file input:focus-visible + .btn { outline: 2px solid var(--brand); outline-offset: 2px; }
.identity-file input:disabled + .btn { opacity: .55; cursor: wait; }
.identity-file span { overflow-wrap: anywhere; }
@media (max-width: 960px) { .identity-grid { grid-template-columns: minmax(0,1fr); } .identity-preview { width: min(100%,250px); } }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], select, textarea {
	width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface);
	border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--ink); cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 18px; }

/* ---------- Paneles */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel > .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.panel > .pb { padding: 16px 20px 20px; }
.panel > .pb.flush { padding: 8px 0 4px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0,1fr)); }

/* ---------- KPIs: una franja, no tarjetas sueltas */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px; }
.kpi { min-width: 0; overflow-wrap: anywhere; padding: 18px 20px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi span { font-size: 13px; color: var(--muted); display: block; }
.kpi b { display: block; font-size: 26px; font-weight: 750; font-stretch: 87%; font-variation-settings: "wdth" 87; margin-top: 4px; letter-spacing: -.01em; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.kpi.alert b { color: var(--bad); }

.stage-row { padding: 7px 0; color: inherit; border-bottom: 1px solid var(--line); }
.stage-row:hover { text-decoration: none; background: #fafbfc; }

/* ---------- Tablas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: #fafbfc; }
.t .code { font-weight: 700; font-stretch: 87%; font-variation-settings: "wdth" 87; }
.t .sub { display: block; font-size: 12.5px; color: var(--muted); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t th.r, .t td.r { text-align: right; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .crop { display: inline-block; margin: 10px 0 18px; padding: 14px 18px; }

/* ---------- Estados */
.chip {
	display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 9px 3px 8px;
	border-radius: 99px; background: color-mix(in srgb, var(--c-st, #64748b) 13%, #fff); color: color-mix(in srgb, var(--c-st, #64748b) 80%, #000); white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c-st, #64748b); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--soft); color: var(--ink-2); }
.tag.hot { background: #fde7f3; color: #a3005f; }
.tag.late { background: #ffedd5; color: var(--bad); }
.tag.ok { background: #dcfce7; color: var(--ok); }
.tag.portal { background: #e0f2fe; color: #075985; }

/* ---------- Tabs y filtros */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs button .n { font-weight: 500; color: var(--muted); margin-left: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 160px; }

/* ---------- Tablero de producción */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.lane { background: var(--soft); border-radius: var(--r-lg); padding: 10px; min-height: 160px; }
.lane.drop { outline: 2px dashed var(--brand); outline-offset: -2px; }
.lane > header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 14px; }
.lane > header i { width: 10px; height: 10px; border-radius: 3px; background: var(--c-st); }
.lane > header span { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }
.job {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; margin-bottom: 8px;
	cursor: grab; box-shadow: 0 1px 0 rgba(27,30,40,.03); border-left: 3px solid var(--c-st);
}
.job:hover { border-color: var(--line-2); border-left-color: var(--c-st); }
.job.dragging { opacity: .45; }
.job .code { font-weight: 750; font-size: 13px; font-stretch: 87%; font-variation-settings: "wdth" 87; }
.job .t1 { font-weight: 600; font-size: 14px; margin: 2px 0; }
.job .t2 { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job footer { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.job footer .due { margin-left: auto; }
.job .job-move { margin-top: 7px; color: var(--brand-ink); }

/* ---------- Detalle de pedido */
.order-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.order-head > div { min-width: 0; overflow-wrap: anywhere; }
.order-head h1 .code { color: var(--muted); font-weight: 600; margin-right: 8px; }
.flow { display: flex; gap: 0; margin: 4px 0 20px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.flow button { flex: 1; min-width: 104px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; border-left: 1px solid var(--line); padding: 11px 8px 10px; cursor: pointer; position: relative; text-align: center; }
.flow button:first-child { border-left: 0; }
.flow button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.flow button.done { color: var(--ink-2); }
.flow button.done::after { background: color-mix(in srgb, var(--c-st) 45%, #fff); }
.flow button.on { color: var(--ink); background: color-mix(in srgb, var(--c-st) 8%, #fff); }
.flow button.on::after { background: var(--c-st); }
.flow button:hover { background: var(--soft); }
.items .it { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 16px; padding: 14px 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.items .it:first-child { border-top: 0; }
.items .it b { font-weight: 600; }
.items .it .money { font-weight: 700; text-align: right; }
.items .it .muted { font-size: 13px; }
.totals { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.totals div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 14px; overflow-wrap: anywhere; }
.totals .grand { font-size: 19px; font-weight: 750; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); font-stretch: 87%; font-variation-settings: "wdth" 87; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13.5px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.status::before { background: var(--brand); }
.timeline li.payment::before { background: var(--ok); }
.timeline li.file::before { background: var(--m); }
.timeline li.message::before { background: var(--c); }
.timeline time { display: block; font-size: 12px; color: var(--muted); }
.balance-bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.balance-bar i { display: block; height: 100%; background: var(--ok); }

/* ---------- Archivos */
.files { display: grid; gap: 8px; }
.files > .file { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.file .thumb { width: 44px; height: 44px; border-radius: 6px; background: var(--soft); display: grid; place-items: center; overflow: hidden; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file b { font-weight: 600; font-size: 14px; word-break: break-all; }
.file .meta { font-size: 12.5px; color: var(--muted); }
.file .acts { display: flex; gap: 4px; }
.drop-zone { position: relative; display: block; overflow-wrap: anywhere; border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s; }
.drop-zone:hover, .drop-zone.over, .drop-zone:focus-within { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); }
.drop-zone b { color: var(--ink); }
.drop-zone.uploading { cursor: progress; }
.art-file-input { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.art-file-tools { margin: 10px 0; align-items: center; }
.art-file-tools .btn { min-height: 38px; }
.art-file-tools span { flex: 1 1 190px; }
.art-progress:not(:empty) { display: grid; gap: 8px; margin-top: 12px; }
.art-progress-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); overflow-wrap: anywhere; }
.art-progress-row progress { width: 100%; height: 7px; margin: 7px 0 0; accent-color: var(--brand); }
.art-upload-error { margin: 6px 0 0; color: var(--bad); }
.progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

/* ---------- Cotizador */
.quote-item { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; background: var(--surface); }
.quote-item header { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.quote-item .result { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 4px; border-top: 1px dashed var(--line-2); gap: 10px; flex-wrap: wrap; }
.quote-item .result b { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
.breakdown { font-size: 13px; color: var(--muted); margin: 8px 0 0; padding: 0; list-style: none; }
.breakdown li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.finishes { display: flex; flex-wrap: wrap; gap: 8px; }
.finishes .check { border: 1px solid var(--line-2); border-radius: 99px; padding: 6px 12px; font-size: 13.5px; }
.finishes .check:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.margin-ok { color: var(--ok); font-weight: 600; }
.margin-low { color: var(--bad); font-weight: 600; }

/* ---------- Editor de listas (productos) */
.rows-editor table { width: 100%; border-collapse: collapse; }
.rows-editor td { padding: 4px; }
.rows-editor td input, .rows-editor td select { padding: 7px 9px; font-size: 14px; }
.rows-editor th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px; }

/* ---------- Modal y toast */
.modal-bg { position: fixed; inset: 0; background: rgba(20,22,30,.45); z-index: 100; display: grid; place-items: center; padding: 18px; animation: fade .15s; }
.modal { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: hidden; box-shadow: 0 24px 60px -20px rgba(0,0,0,.4); animation: pop .18s ease-out; }
.modal.wide { width: min(880px, 100%); }
.modal > header { flex: none; display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 14px 22px 0; }
.modal > header h2 { min-width: 0; overflow-wrap: anywhere; }
.modal > .mb { min-height: 0; padding: 16px 22px; overflow: auto; overscroll-behavior: contain; }
.modal > footer { flex: none; display: flex; gap: 8px; justify-content: flex-end; padding: 10px 22px 14px; border-top: 1px solid var(--line); }
@media screen { body:has(.modal-bg) { overflow: hidden; } }
.x { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--muted); }
.x svg { width: 20px; height: 20px; display: block; }
.x:hover { background: var(--soft); color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: 14px; box-shadow: var(--shadow); animation: pop .2s; max-width: 380px; }
.toast.err { background: var(--bad); }

/* ---------- Gráficos simples */
.chart { width: 100%; height: 200px; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--brand-ink); }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .track { height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .art .mark { width: 38px; height: 38px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.auth .art img { height: 40px; width: auto; max-width: 180px; object-fit: contain; border-radius: 6px; background: #fff; }
.auth .art h1 { font-size: clamp(34px, 4vw, 54px); font-weight: 800; max-width: 12ch; font-stretch: 75%; font-variation-settings: "wdth" 75; letter-spacing: -.015em; }
.auth .art p { color: #a7adba; max-width: 40ch; font-size: 16px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; max-width: 360px; }
.swatches div { aspect-ratio: 1; }
.swatches div:nth-child(1){background:var(--c)} .swatches div:nth-child(2){background:var(--m)} .swatches div:nth-child(3){background:var(--y)} .swatches div:nth-child(4){background:#000;outline:1px solid #3a3f4b;outline-offset:-1px}
.swatch-lbl { display: grid; grid-template-columns: repeat(4,1fr); max-width: 360px; font-size: 12px; color: #8f95a3; margin-top: 8px; }
.auth .form { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.auth .box { width: min(430px, 100%); padding: 34px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px #101a2a0d; }
.auth .box h2 { margin-bottom: 4px; }
.auth .box > p { color: var(--muted); margin-bottom: 22px; }
.activation-kicker { display: inline-block; margin-bottom: 8px; color: var(--brand-ink); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.activation-code { font-family: ui-monospace, monospace; letter-spacing: .02em; }
.login-activation { margin-top: 12px; }
.auth .switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth .switch button { background: none; border: 0; color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; }
.demo-logins { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); font-size: 13px; }
.demo-logins button { display: flex; width: 100%; justify-content: space-between; align-items: center; background: var(--soft); border: 0; border-radius: var(--r-sm); padding: 9px 12px; margin-top: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.demo-logins button:hover { background: var(--brand-tint); }
.alert-box { padding: 11px 14px; border-radius: var(--r); background: #fff7ed; color: #9a3412; font-size: 14px; margin-bottom: 14px; }
.alert-box.info { background: var(--brand-tint); color: var(--brand-ink); }

/* ---------- Portal */
.ep-portal { background: var(--paper); }
.pnav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.pnav .in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.pnav .brand { display: flex; min-width: 0; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; color: var(--ink); font-stretch: 87%; font-variation-settings: "wdth" 87; }
.pnav .brand > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.pnav .brand img { height: 36px; width: auto; max-width: min(160px,28vw); object-fit: contain; border-radius: 6px; }
.pnav .brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.pnav nav { display: flex; gap: 4px; }
.pnav nav a { padding: 8px 12px; border-radius: var(--r); color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.pnav nav a.on { background: var(--soft); color: var(--ink); }
.pnav nav a:hover { text-decoration: none; background: var(--soft); }
.pnav .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pnav .reg { height: 3px; border-radius: 0; }
.pwrap { max-width: 1120px; margin: 0 auto; padding: 30px 20px 70px; }
.portal-auth { display: grid; place-items: center; padding: 20px 0 40px; }
.portal-auth .box { width: min(440px, 100%); padding: clamp(18px, 5vw, 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-wrap: anywhere; }
.portal-auth .box h2 { margin-bottom: 8px; }
.portal-auth .switch { margin-top: 14px; font-size: 14px; }
.portal-welcome { background: var(--brand-tint); }
.portal-welcome p { margin: 0; overflow-wrap: anywhere; }
.portal-welcome h1 { margin: 4px 0 8px; }
.portal-welcome + .portal-activity { margin-top: 16px; }
.portal-shortcuts { margin: 16px 0 20px; }
.portal-shortcut { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--ink); overflow-wrap: anywhere; }
.portal-shortcut:hover, .portal-shortcut:focus-visible { text-decoration: none; border-color: var(--brand); }
.portal-shortcut span > span { display: block; margin-top: 3px; }
.portal-shortcut-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 8px; color: var(--brand); background: var(--brand-tint); }
.portal-shortcut-icon svg { width: 18px; height: 18px; }
.portal-recent { display: grid; gap: 8px; }
.portal-recent a { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); overflow-wrap: anywhere; }
.portal-recent a:hover, .portal-recent a:focus-visible { border-color: var(--brand); text-decoration: none; }
.phero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; margin: 10px 0 34px; }
.phero h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; max-width: 16ch; letter-spacing: -.015em; }
.phero > div:first-child > p { font-size: 17px; color: var(--ink-2); max-width: 46ch; margin-top: 12px; }
.phero .sheet { background: var(--surface); padding: 22px; border-radius: 4px; box-shadow: var(--shadow); }
.cat-group { margin-bottom: 26px; }
.cat-group h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.prod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.prod { text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; cursor: pointer; transition: border-color .12s; }
.prod:hover { border-color: var(--brand); }
.prod b { display: block; font-size: 16px; font-weight: 700; }
.prod p { font-size: 13.5px; color: var(--muted); margin: 4px 0 10px; }
.prod .from { font-size: 13px; color: var(--ink-2); }
.prod .from strong { font-variant-numeric: tabular-nums; }
.steps { display: flex; gap: 0; margin: 16px 0 6px; }
.steps div { flex: 1; min-width: 0; text-align: center; font-size: 12px; color: var(--muted); position: relative; padding: 18px 2px 0; overflow-wrap: anywhere; }
.steps div::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line); }
.steps div::after { content: ""; position: absolute; top: 0; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.steps div.done::before { background: var(--brand); }
.steps div.done::after { background: var(--brand); border-color: var(--brand); }
.steps div.on { color: var(--ink); font-weight: 600; }
.steps div.on::after { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
@media (max-width: 560px) {
	.steps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); row-gap: 12px; }
}
.proof { border: 2px solid var(--m); border-radius: var(--r-lg); padding: 16px; background: #fff5fb; }

/* ---------- Impresión (cotización / orden / informes) */
.print-doc, #print-root { display: none; }
#print-root { color: #000; font-size: 12px; }
#print-root h1 { font-size: 22px; }
#print-root table { width: 100%; border-collapse: collapse; margin: 12px 0; }
#print-root th, #print-root td { border-bottom: 1px solid #ccc; padding: 6px 4px; text-align: left; }
#print-root .r { text-align: right; }
#print-root .reg { width: 120px; height: 5px; margin-left: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print-root .reg i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print-root .ph { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
@media print {
	body { background: #fff; }
	body.doc-print > *:not(#print-root) { display: none !important; }
	body.doc-print #print-root { display: block; }
	.side, .top, .demo-band, .page-head .actions, .filters, .toasts, .modal-bg, .burger { display: none !important; }
	.shell { display: block; }
	.page { padding: 0; max-width: none; }
	.panel, .kpis { break-inside: avoid; }
	.cols.even { grid-template-columns: 1fr 1fr; }
}

/* ---------- Responsive */
@media (max-width: 1100px) {
	.cols, .cols.even { grid-template-columns: minmax(0, 1fr); }
	.modal .cols { grid-template-columns: minmax(0, 1fr) !important; }
	.kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.kpi:nth-child(3) { border-left: 0; }
	.kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
	.g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
	.shell { grid-template-columns: minmax(0, 1fr); }
	.side { position: fixed; inset: 0 auto 0 0; width: min(280px, calc(100% - 36px)); visibility: hidden; transform: translateX(-100%); transition: transform .2s, visibility .2s; }
	.side.open { visibility: visible; transform: none; }
	.drawer-shade:not(.hidden) { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(14,19,29,.48); }
	body.drawer-open { overflow: hidden; }
	.side .drawer-close { display: inline-flex; min-width: 42px; min-height: 42px; padding: 6px; color: #c9cdd6; }
	.side .drawer-close:hover { background: rgba(255,255,255,.1); color: #fff; }
	.top { padding: 10px 16px; }
	.top .burger { display: inline-flex; }
	.page { padding: 20px 16px 60px; }
	.demo-band { padding: 7px 16px; }
	.g2, .g3 { grid-template-columns: minmax(0, 1fr); }
	.demo-band { flex-wrap: wrap; font-size: 12.5px; }
	.demo-band .btn { padding: 5px 9px; font-size: 12px; }
	.page-head .actions { width: 100%; }
	.flow button { min-width: 92px; }
	.auth { grid-template-columns: 1fr; }
	.auth .art { padding: 28px 24px; min-height: 0; gap: 20px; }
	.auth .art .swatches, .auth .art .swatch-lbl { display: none; }
	.phero { grid-template-columns: 1fr; }
	.pnav .in { flex-wrap: wrap; gap: 10px; }
	.pnav nav { order: 3; width: 100%; overflow-x: auto; }
	h1 { font-size: 25px; }
	.kv { grid-template-columns: 100px 1fr; }
	.hbar { grid-template-columns: 100px 1fr auto; }
	.top .search { max-width: none; }
}
@media (max-width: 520px) {
	.kpi { padding: 12px; }
	.kpi b { font-size: clamp(17px, 5.2vw, 21px); }
	.g4 { grid-template-columns: 1fr; }
	.auth .box { padding: 26px 20px; }
	.top .new-label { display: none; }
}

/* ===== Documento de cobro (facturación) ===== */
.inv-wrap { max-width: 820px; }
.inv { --inv: #0e7490; position: relative; background: #fff; color: #111827; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 0 34px 26px; overflow: hidden; font-size: 13px; line-height: 1.45; }
.inv-bar { height: 6px; margin: 0 -34px 24px; background: linear-gradient(90deg, #00a0e3 0 25%, #e6007e 25% 50%, #ffed00 50% 75%, #1b1e28 75%); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--inv); }
.inv-from, .inv-id, .inv-to { display: flex; flex-direction: column; gap: 2px; }
.inv-from img { max-height: 54px; max-width: 180px; object-fit: contain; align-self: flex-start; margin-bottom: 6px; }
.inv-from b { font-size: 17px; }
.inv-from span, .inv-to span, .inv-id span { color: #4b5563; }
.inv-id { text-align: right; align-items: flex-end; }
.inv-id small, .inv-to small { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--inv); font-weight: 700; }
.inv-id strong { font-size: 24px; letter-spacing: -.01em; }
.inv-to { margin: 18px 0 6px; padding: 12px 14px; background: #f7f8fa; border-radius: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-to b { font-size: 15px; }
.inv table.inv-items { width: 100%; border-collapse: collapse; margin: 14px 0; }
.inv-items th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; border-bottom: 1px solid #d1d5db; padding: 8px 6px; }
.inv-items td { border-bottom: 1px solid #eef0f3; padding: 9px 6px; vertical-align: top; }
.inv-items .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-sub { color: #6b7280; font-size: 12px; }
.inv-sum { margin-left: auto; width: min(320px, 100%); }
.inv-sum div { display: flex; justify-content: space-between; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.inv-sum .inv-total { margin-top: 6px; padding: 10px; background: var(--inv); color: #fff; border-radius: 8px; font-weight: 700; font-size: 15px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-notes { margin: 14px 0 0; }
.inv-foot { margin-top: 26px; padding-top: 12px; border-top: 1px dashed #d1d5db; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #6b7280; }
.inv-stamp { position: absolute; top: 120px; left: 50%; transform: translateX(-50%) rotate(-14deg); border: 4px solid #dc2626; color: #dc2626; font-size: 44px; font-weight: 800; letter-spacing: .12em; padding: 4px 22px; border-radius: 8px; opacity: .35; pointer-events: none; }
#print-root .inv { border: 0; padding: 0; }
#print-root .inv-bar { margin: 0 0 20px; }
#print-root .inv table, #print-root .inv th, #print-root .inv td { border-left: 0; border-right: 0; }
@media (max-width: 640px) {
	.inv { padding: 0 16px 18px; }
	.inv-bar { margin: 0 -16px 18px; }
	.inv-head { flex-direction: column; }
	.inv-id { text-align: left; align-items: flex-start; }
	.kpis { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ===== Recorrido guiado ===== */
.tour-band { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 22px; background: var(--ink); color: #fff; font-size: 13.5px; }
.tour-band b { font-weight: 700; }
.tour-band .sp { flex: 1; }
.tour-band button, .tour-band a { font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 7px; padding: 6px 12px; cursor: pointer; text-decoration: none; }
.tour-band a.cta { background: #fff; color: var(--ink); }
.tour-shade { position: fixed; inset: 0; background: rgba(15,18,28,.62); z-index: 9990; opacity: 0; pointer-events: none; transition: opacity .25s; }
.tour-shade.on { opacity: 1; }
.tour-hole { position: fixed; z-index: 9991; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15,18,28,.62), 0 0 0 3px var(--brand) inset; pointer-events: none; opacity: 0; transition: top .35s ease, left .35s ease, width .35s ease, height .35s ease, opacity .2s; }
body:not(.tour-on) .tour-hole, body:not(.tour-on) .tour-pop, body:not(.tour-on) .tour-shade { display: none; }
.tour-pop { position: fixed; z-index: 9992; width: min(360px, calc(100vw - 24px)); background: #fff; color: var(--ink); border-radius: 14px; padding: 18px 20px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.28); transition: opacity .2s, transform .2s; }
.tour-pop.moving { opacity: 0; transform: translateY(6px); }
.tour-pop.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); padding: 26px 28px 22px; }
.tour-pop.center.moving { transform: translate(-50%, calc(-50% + 6px)); }
.tour-pop.sheet { left: 10px !important; right: 10px; bottom: 10px; top: auto !important; width: auto; }
.tour-bar { display: flex; height: 4px; margin: -18px -20px 14px; border-radius: 14px 14px 0 0; overflow: hidden; }
.tour-pop.center .tour-bar { margin: -26px -28px 18px; }
.tour-bar i { flex: 1; } .tour-bar i:nth-child(1) { background: #00a0e3; } .tour-bar i:nth-child(2) { background: #e6007e; } .tour-bar i:nth-child(3) { background: #ffed00; } .tour-bar i:nth-child(4) { background: #1b1e28; }
.tour-step { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.tour-pop h3 { margin: 4px 0 6px; font-size: 18px; font-stretch: 90%; font-variation-settings: "wdth" 90; letter-spacing: -.01em; }
.tour-pop.center h3 { font-size: 23px; }
.tour-pop p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tour-tag { display: inline-block; margin-left: 4px; font-size: 11.5px; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 1px 7px; }
.tour-prog { height: 3px; background: var(--line); border-radius: 3px; margin: 14px 0 12px; overflow: hidden; }
.tour-prog span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.tour-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-acts > span { flex: 1; }
.tour-btn { font: inherit; font-size: 14px; font-weight: 650; border: 0; border-radius: 9px; padding: 9px 16px; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; }
.tour-btn.ghost { background: var(--soft, #f1f3f6); color: var(--ink); }
.tour-btn.link { background: none; color: var(--muted, #6b7280); padding: 9px 4px; }
.tour-pop.center .tour-acts { justify-content: flex-end; }
.tour-fab { position: fixed; z-index: 9989; right: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 700; color: #fff; background: var(--ink); border: 0; border-radius: 999px; padding: 11px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; }
.tour-fab span { font-size: 11px; }
body.tour-on .tour-fab { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-pop, .tour-prog span { transition: none; } }
@media (max-width: 640px) { .tour-band { padding: 8px 14px; font-size: 12.5px; } .tour-fab { right: 12px; bottom: 12px; } }
.demo-band { flex-wrap: wrap; }
.demo-band .row button { margin-left: 0; }
.tour-launch { gap: 7px; font-weight: 650; }
.tour-launch .tl-ico { font-size: 10px; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; padding-left: 2px; }
@media (max-width: 640px) { .tour-launch .tl-txt { display: none; } .tour-launch { padding-left: 10px; padding-right: 10px; } }

/* ===== Ojito de contraseña ===== */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted, #6b7280); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: var(--soft, #f1f3f6); }

/* ===== Ingreso: crear cuenta (secundario) ===== */
.login-alt { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2, #d3d8e0); display: grid; gap: 8px; text-align: center; }
.login-alt span { font-size: 13.5px; color: var(--muted, #6b7280); }

/* ===== Barra superior: buscador amplio y botón Salir ===== */
.top .search { max-width: 560px; min-width: 240px; }
.top .search input { height: 42px; font-size: 15px; }
.top-out { gap: 6px; }
@media (max-width: 860px) {
	.top { flex-wrap: wrap; row-gap: 10px; }
	.top .search { order: 10; flex: 1 1 100%; min-width: 0; max-width: none; }
	.top .search input { height: 44px; font-size: 16px; }
	.top .spacer { flex: 1; }
}
@media (max-width: 520px) {
	.top-out span { display: none; }
	.top .btn { padding-left: 11px; padding-right: 11px; }
}
/* Filtros y búsquedas a lo ancho en celular */
@media (max-width: 640px) {
	.filters { display: grid; grid-template-columns: 1fr 1fr; }
	.filters > * { width: 100% !important; min-width: 0 !important; }
	.filters input[type=search], .filters input[type=text], .filters .btn { grid-column: 1 / -1; }
	.page input[type=search] { width: 100% !important; max-width: none !important; min-width: 0 !important; font-size: 16px; }
	.page-head .actions .btn { flex: 1 1 auto; justify-content: center; }
	.t-cards, .t-cards tbody, .t-cards tr { display: block; }
	.t-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.t-cards tr { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
	.t-cards tr:last-child { border-bottom: 0; }
	.t-cards td, .t-cards td.r { min-width: 0; padding: 4px 0; border: 0; text-align: start; overflow-wrap: anywhere; }
	.t-cards td[data-label] { display: grid; grid-template-columns: minmax(62px,.7fr) minmax(0,1.3fr); gap: 8px; align-items: baseline; }
	.t-cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 650; }
	.t-cards td[data-label] > * { justify-self: start; min-width: 0; }
	.t-cards .t-card-title { display: block; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
	.t-cards .t-card-title a { display: inline-block; padding-block: 5px; }
	.t-cards .sub { max-width: none; white-space: normal; }
}
/* Buscador ocupa el espacio libre; los botones quedan a la derecha */
.top .spacer { display: none; }
.top .search { flex: 1 1 auto; max-width: 640px; }
.top #tour-btn { margin-left: auto; }
@media (max-width: 520px) { .top-out span { display: inline; } .top-out { font-size: 13.5px; } }
@media (max-width: 860px) { .top .search { flex: 1 1 100%; max-width: none; } }

/* Imprato 3.8.3 · refinamientos visuales y de accesibilidad compatibles */
.shell { min-width: 0; }
.side { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.page > * { min-width: 0; }
.top { min-width: 0; }
.top button, .top a, .nav a, .btn { touch-action: manipulation; }
.field input, .field select, .field textarea { max-width: 100%; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.modal-bg { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.modal { max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom))); }
.modal > footer { flex-wrap: wrap; }
@media (max-width: 860px) {
  .side { height: 100dvh; padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .main { min-width: 0; }
  .page-head .actions > * { max-width: 100%; }
}
@media (max-width: 520px) {
  .page { padding: 18px 14px max(64px, env(safe-area-inset-bottom)); }
  .top { gap: 8px; padding: 8px 14px; }
  .modal > header { padding: 10px 16px 0; }
  .modal > .mb { padding: 16px; }
  .modal > footer { padding: 10px 16px 12px; }
  .modal > footer .btn { flex: 1 1 auto; }
  .page-head .actions .btn { min-height: 40px; }
  .panel > .ph { flex-wrap: wrap; }
  .pnav nav a { flex: 1 1 0; display: flex; justify-content: center; align-items: center; padding: 8px 4px; text-align: center; line-height: 1.3; }
  .files > .file { grid-template-columns: 36px minmax(0,1fr); gap: 8px; }
  .file .thumb { width: 36px; height: 36px; }
  .file .acts { grid-column: 2; flex-wrap: wrap; }
  .items .it { padding-inline: 14px; gap: 4px 9px; }
  .inv { overflow-wrap: anywhere; }
}

/* Menú por áreas y permisos del equipo. */
.side { overflow: hidden; }
.side > :not(.nav) { flex-shrink: 0; }
.nav { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.24) transparent; }
.nav-group { display: grid; gap: 1px; }
.nav-group + .nav-group { margin-top: 5px; }
.nav-heading { padding: 5px 10px 2px; font-size: 10px; font-weight: 750; color: #a3b0be; text-transform: uppercase; letter-spacing: .095em; }
.nav-group a { padding-top: 7px; padding-bottom: 7px; }
.top-role { color: var(--ink); font-weight: 700; }
@media (pointer: coarse) {
	.nav-group a { min-height: 42px; }
	.top .btn, .modal .x, .modal > footer .btn { min-height: 44px; }
	.job .job-move { min-height: 40px; }
	.modal .x { min-width: 44px; }
	.field :is(input:not([type=checkbox],[type=radio],[type=color]),select,textarea) { font-size: 16px; }
}
.team-permissions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 9px; }
.team-permissions legend { padding: 0 5px; font-size: 13px; font-weight: 750; }
.team-permission { display: flex; align-items: flex-start; gap: 7px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.team-permission input { flex: none; margin: 3px 0 0; }
.team-permission strong, .team-permission small { display: block; }
.team-permission small { color: var(--muted); }
@media (max-width: 500px) {
	.team-permissions { grid-template-columns: minmax(0,1fr); }
}
