/* ================= App ================= */
body { background: var(--bg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 1.15fr 1fr; background: #fff; transition: opacity .5s ease, transform .5s ease; }
.login.out { opacity: 0; transform: scale(1.02); pointer-events: none; }
.login-visual { position: relative; overflow: hidden; background: var(--ink); color: #fff; }
.login-visual video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lv-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,14,.55) 0%, rgba(10,11,14,.25) 40%, rgba(10,11,14,.9) 100%); }
.lv-brand { position: absolute; top: 32px; left: 40px; z-index: 2; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; }
.lv-copy { position: absolute; left: 40px; right: 40px; bottom: 44px; z-index: 2; max-width: 560px; }
.lv-copy p { font-size: 30px; line-height: 1.25; margin: 0 0 14px; }
.lv-copy span { font-size: 14px; color: rgba(255,255,255,.65); }
.login-panel { display: grid; place-items: center; padding: 40px 24px; perspective: 1400px; background: radial-gradient(circle at 70% 20%, #FBF8F2, #fff 60%); }
.login-card { width: 100%; max-width: 400px; animation: cardIn .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes cardIn { from { opacity: 0; transform: rotateX(18deg) translateY(30px); } }
.login-card h1 { font-size: 40px; margin-bottom: 6px; }
.login-card > p { margin: 0 0 28px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field input { height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; background: #fff; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.field input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17,19,24,.06); }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.pw button:hover { background: var(--bg); }
.login-error { color: var(--bad); font-size: 14px; margin: -4px 0 12px; }
.login-btn { width: 100%; height: 50px; margin-top: 6px; font-size: 16px; }
.login-note { display: flex; gap: 10px; margin-top: 22px; padding: 14px; border-radius: 10px; background: var(--warm); font-size: 13px; color: var(--text); }
.login-note .ico { color: var(--brass); margin-top: 1px; }
.login-note p { margin: 0; }
.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- app shell ---------- */
.app { --brand: #111318; --brand-ink: #fff; --brand-2: #24272e; --accent: #A8782F; --accent-ink: #fff; --accent-soft: #F4ECDE; --accent-line: #DCC39A;
  display: grid; grid-template-columns: 300px 1fr; grid-template-rows: 68px 1fr; height: 100vh; height: 100dvh; opacity: 0; transition: opacity .5s ease; }
.app.in { opacity: 1; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.main { overflow-y: auto; padding: 26px 30px 60px; scroll-behavior: smooth; }
.app.swap .main, .app.swap .side { animation: swap .45s ease; }
@keyframes swap { 0% { opacity: .2; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }

.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-accent:hover { filter: brightness(.94); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* logos */
.logo { display: inline-grid; place-items: center; flex: none; border-radius: 9px; font-family: var(--serif); font-weight: 600; letter-spacing: .02em; overflow: hidden; }
.logo.has-img { background: var(--ink); }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.lg-sm { width: 36px; height: 36px; font-size: 14px; }
.lg-md { width: 46px; height: 46px; font-size: 17px; border-radius: 11px; }

/* company switcher */
.company { position: relative; width: 262px; flex: none; }
.company-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; transition: border-color .15s, box-shadow .15s; }
.company-btn:hover { border-color: #cfc9be; box-shadow: var(--shadow-sm); }
.cb-txt { flex: 1; min-width: 0; }
.cb-txt b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-txt i { font-style: normal; font-size: 12px; color: var(--muted); }
.chev { width: 16px; height: 16px; color: var(--muted); }
.company-menu, .user-menu { position: absolute; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; animation: pop .18s ease; z-index: 30; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.company-menu { left: 0; width: 320px; }
.cm-label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 8px; }
.company-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 10px; text-align: left; }
.company-menu button:hover { background: var(--bg); }
.company-menu button.on { background: var(--warm); }
.company-menu button > span:not(.logo) { flex: 1; min-width: 0; }
.company-menu .logo { flex: none; }
.company-menu b { display: block; font-size: 14px; color: var(--ink); }
.company-menu i { font-style: normal; font-size: 12px; color: var(--muted); }
.company-menu .ico { color: var(--good); }
.cm-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.cm-manage { font-size: 14px; font-weight: 600; color: var(--ink); }
.cm-manage .ico { color: var(--ink) !important; width: 18px; }

/* tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; margin: 0 auto; }
.tabs button { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.tabs button .ico { width: 18px; height: 18px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(17,19,24,.1); }
.tabs button.on .ico { color: var(--accent); }

/* user */
.user { position: relative; flex: none; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 10px; }
.user-btn:hover { background: var(--bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--accent-soft, var(--brass-soft)); color: var(--ink); flex: none; }
.avatar.dark { background: var(--ink); color: #fff; }
.user-txt { text-align: left; }
.user-txt b { display: block; font-size: 14px; color: var(--ink); }
.user-txt i { font-style: normal; font-size: 12px; color: var(--muted); }
.user-menu { right: 0; width: 260px; }
.user-menu button, .user-menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; background: transparent; border-radius: 10px; font-size: 14px; color: var(--ink); text-align: left; }
.user-menu button:hover, .user-menu a:hover { background: var(--bg); }
.user-menu .ico { width: 18px; height: 18px; color: var(--muted); }

/* ---------- side ---------- */
.side { background: var(--brand); color: var(--brand-ink); display: flex; flex-direction: column; overflow: hidden; transition: background .45s ease; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 12px; }
.side-head b { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.side-head span { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--brand-ink) 12%, transparent); }
.side-list { flex: 1; overflow-y: auto; padding: 0 12px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; }
.pitem { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; transition: background .15s, transform .15s; }
.pitem:hover { background: color-mix(in srgb, var(--brand-ink) 7%, transparent); }
.pitem.on { background: color-mix(in srgb, var(--brand-ink) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.pitem img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; }
.pi-txt { min-width: 0; }
.pi-txt b { display: block; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-txt i { display: block; font-style: normal; font-size: 12px; opacity: .65; margin-top: 2px; }
.pi-txt em { display: block; font-style: normal; font-size: 12px; opacity: .85; margin-top: 2px; }
.st { font-weight: 600; }
.st::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.st.good::before { background: #3FB37F; } .st.warn::before { background: #E3A23B; } .st.bad::before { background: #E2654C; }
.side-add { margin: 12px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--brand-ink) 35%, transparent); background: transparent; color: inherit; font-weight: 600; font-size: 14px; }
.side-add:hover { background: color-mix(in srgb, var(--brand-ink) 7%, transparent); }
.side-empty { padding: 10px; font-size: 14px; opacity: .7; }

/* ---------- views ---------- */
.view { display: none; max-width: 1240px; margin: 0 auto; }
.view.on { display: block; animation: viewIn .4s cubic-bezier(.2,.7,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.card-head h2 { font-size: 19px; margin-bottom: 4px; }
.card-head p { margin: 0; font-size: 14px; color: var(--muted); max-width: 560px; }
.card h3 { font-size: 16px; }

/* property head */
.phead { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.phead > img { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow); }
.ph-txt { flex: 1; min-width: 0; }
.ph-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phead h1 { font-size: 28px; }
.ph-txt > p { margin: 2px 0 6px; color: var(--muted); }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-meta span { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.good::before { background: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.warn::before { background: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.bad::before { background: var(--bad); }
.wsel { display: grid; gap: 4px; flex: none; }
.wsel span { font-size: 12px; font-weight: 600; color: var(--muted); }
.wsel select { height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0 12px; font-weight: 600; color: var(--ink); min-width: 220px; }

/* ---------- semana ---------- */
.g-semana { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-bottom: 20px; align-items: start; }
.week-pick { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; }
.wp-btn { width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink); }
.wp-btn:disabled { opacity: .35; cursor: default; }
.wp-txt { text-align: center; min-width: 120px; }
.wp-txt b { display: block; font-size: 14px; color: var(--ink); }
.wp-txt span { font-size: 12px; color: var(--muted); }
.badge { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 6px; letter-spacing: .02em; }
.badge.new { background: var(--accent-soft); color: var(--ink); }
.badge.saved { background: var(--good-soft); color: var(--good); }

.inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.inp { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; cursor: text; }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-1px); }
.inp.err { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.inp-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.inp-label i { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inp input { border: 0; outline: none; font-size: 30px; font-weight: 600; color: var(--ink); width: 100%; padding: 0; background: transparent; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.inp input::-webkit-outer-spin-button, .inp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inp input::placeholder { color: #D5D0C7; }
.inp-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-height: 20px; }
.inp-foot i { font-style: normal; }
.inp-foot b { color: var(--text); }
.delta { font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat, .delta.na { color: var(--muted); }

.fb { display: grid; gap: 6px; margin-top: 14px; }
.fb > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.fb textarea, .rc textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical; outline: none; font-size: 14.5px; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.fb textarea:focus, .rc textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.warns { display: grid; gap: 8px; margin-top: 12px; }
.alert-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: #7A4D0B; font-size: 13.5px; animation: pop .2s ease; }
.alert-row .ico { width: 18px; height: 18px; color: var(--warn); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.spacer { flex: 1; }

.live-card { position: sticky; top: 0; }
.lc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lr { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.lr span { font-size: 14px; color: var(--ink); font-weight: 500; }
.lr span i { display: block; font-style: normal; font-size: 12px; color: var(--muted); font-weight: 400; }
.lr b { grid-row: 1; grid-column: 2; text-align: right; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.lr .delta { grid-column: 2; text-align: right; }
.lc-diag { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--bg); }
.lc-diag p { margin: 8px 0 0; font-size: 13.5px; color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 22px; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td b { display: block; color: var(--ink); }
.tbl td span { font-size: 12px; color: var(--muted); }
.tbl .n { text-align: right; }
.tbl .f { font-family: var(--serif); color: var(--accent); }
.tbl tbody tr { transition: background .12s; }
.hist-card .tbl tbody tr { cursor: pointer; }
.hist-card .tbl tbody tr:hover { background: var(--bg); }
.tbl tr.on { background: var(--accent-soft) !important; }
.tbl .empty { text-align: center; color: var(--muted); padding: 30px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn.del.confirm { background: var(--bad); color: #fff; }

/* ---------- evolucion ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; perspective: 1000px; }
.kpi { padding: 16px 18px 12px; transition: transform .25s ease, box-shadow .25s ease; }
.kpi:hover { transform: translateY(-3px) rotateX(4deg); box-shadow: var(--shadow); }
.kpi > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi > b { display: block; font-size: 30px; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 30px; margin-top: 8px; }
.g-evo { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.cc-head span { font-size: 12.5px; color: var(--muted); }
.cc-body { position: relative; height: 260px; }
.diag-card { border-top: 4px solid var(--good); display: flex; flex-direction: column; }
.diag-card.warn { border-top-color: var(--warn); } .diag-card.bad { border-top-color: var(--bad); }
.dc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.diag-card h3 { font-size: 24px; margin-bottom: 12px; }
.diag-card ul { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; }
.diag-card .rec { margin: auto 0 16px; padding: 12px 14px; background: var(--bg); border-radius: 10px; font-size: 14px; }
.diag-card .rec b { color: var(--ink); font-weight: 600; }
.diag-card .btn { align-self: flex-start; }
.funnel { display: grid; gap: 10px; }
.fn-row { display: grid; grid-template-columns: 96px 1fr 50px 44px; align-items: center; gap: 10px; font-size: 13.5px; }
.fn-l { color: var(--ink); font-weight: 500; }
.fn-bar { height: 26px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.fn-row b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.fn-row em { font-style: normal; font-size: 12px; color: var(--muted); text-align: right; }
.fn-note { font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.ratio-card .tbl { margin: 0 -22px; width: calc(100% + 44px); }
.ratio-card .tbl tr:last-child td { border-bottom: 0; }

/* ---------- informe ---------- */
.rep { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; }
.rep-ctrl { display: grid; gap: 14px; position: sticky; top: 0; }
.rc { padding: 18px; }
.rc h3 { margin-bottom: 12px; }
.rc h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.rc .wsel select { width: 100%; }
.rc .small { margin: 10px 0 0; }
.tg-list { display: grid; gap: 2px; }
.tg { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 14px; color: var(--ink); user-select: none; }
.tg input { position: absolute; opacity: 0; pointer-events: none; }
.tg-ui { width: 36px; height: 20px; border-radius: 999px; background: #D9D4CB; position: relative; transition: background .2s; flex: none; }
.tg-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.tg input:checked + .tg-ui { background: var(--accent); }
.tg input:checked + .tg-ui::after { transform: translateX(16px); }
.tg input:focus-visible + .tg-ui { box-shadow: 0 0 0 3px var(--accent-soft); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.color input { grid-row: span 2; width: 34px; height: 34px; border: 0; padding: 0; background: none; border-radius: 8px; cursor: pointer; }
.color input::-webkit-color-swatch-wrapper { padding: 0; }
.color input::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.1); border-radius: 8px; }
.color span { font-size: 13px; font-weight: 600; color: var(--ink); }
.color code { font-size: 11.5px; color: var(--muted); }
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.upl { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 1px dashed #cfc9be; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
.upl:hover { background: var(--bg); border-color: var(--ink); }
.upl input { display: none; }
.upl .ico { width: 17px; height: 17px; }
.link { border: 0; background: none; padding: 0; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.rc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.rc-foot .link { margin: 0; }

.rep-view { min-width: 0; }
.rv-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.rv-bar b { display: block; font-size: 16px; color: var(--ink); }
.rv-bar span { font-size: 13px; color: var(--muted); }
.pages { position: relative; }
.paper { width: 794px; height: 1123px; transform-origin: top left; background: #fff; box-shadow: 0 30px 80px rgba(17,19,24,.16), 0 0 0 1px rgba(17,19,24,.05); position: relative; overflow: hidden; color: #2B2F37; font-family: var(--sans); animation: paperIn .7s cubic-bezier(.2,.7,.2,1); margin-bottom: 24px; }
@keyframes paperIn { from { opacity: 0; } }

/* paper content (A4 at 96dpi) */
.pp-head { background: var(--p1); color: var(--p1-ink); padding: 22px 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 3px solid var(--p2); }
.pp-head.small { padding: 14px 40px; }
.pp-brand { display: flex; align-items: center; gap: 14px; }
.pp-logoimg { height: 92px; width: auto; display: block; }
.pp-head.small .pp-logoimg { height: 54px; }
.pp-logo { width: 54px; height: 54px; border-radius: 12px; background: var(--p2); color: var(--p2-ink); display: grid; place-items: center; font-family: var(--pfont); font-weight: 600; font-size: 20px; }
.pp-brand b { display: block; font-family: var(--pfont); font-weight: 500; font-size: 20px; line-height: 1.2; }
.pp-brand span { font-size: 12px; opacity: .7; }
.pp-title { text-align: right; }
.pp-title span { display: block; font-family: var(--pfont); font-size: 15px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--p2); }
.pp-title b { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }
.pp-title i { display: block; font-style: normal; font-size: 12px; opacity: .7; margin-top: 2px; }
.pp-prop { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding: 24px 40px 0; }
.pp-photo { height: 196px; border-radius: 8px; overflow: hidden; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; }
.pp-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--p2); }
.pp-info h2 { font-family: var(--pfont); font-weight: 600; font-size: 19px; color: #111318; margin: 4px 0 10px; line-height: 1.25; }
.pp-info dl { margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.pp-info dt { font-size: 9.5px; color: #6B7280; text-transform: uppercase; letter-spacing: .08em; }
.pp-info dd { margin: 0; font-size: 12.5px; font-weight: 600; color: #111318; }
.pp-feat { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-feat span { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: #F4F2EE; color: #2B2F37; }
.pp-block { padding: 16px 40px 0; }
.pp-block h3, .pp-row h3, .pp-gauge h3, .pp-diag h3 { font-family: var(--pfont); font-size: 14px; font-weight: 600; color: #111318; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid #ECE8E1; }
.pp-gauge { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 22px 40px 0; }
.pg-dial canvas { display: block; margin: 0 auto; }
.pg-val { text-align: center; margin-top: 6px; }
.pg-val b { display: block; font-size: 34px; line-height: 1.2; margin-bottom: 12px; color: #111318; }
.pg-hist canvas { width: 400px !important; height: 190px !important; display: block; }
.pg-legend { display: flex; gap: 12px; font-size: 10px; color: #3A3F48; margin-top: 4px; }
.pg-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.pp-status { display: inline-block; margin-top: 0; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.pp-status.good { background: var(--good-soft); color: var(--good); } .pp-status.warn { background: var(--warn-soft); color: var(--warn); } .pp-status.bad { background: var(--bad-soft); color: var(--bad); }
.pp-kpis { display: grid; gap: 8px; }
.pp-kpis div { background: var(--p2-soft); border-radius: 8px; padding: 10px 10px 8px; border-top: 3px solid var(--p2); }
.pp-kpis span { display: block; font-size: 10.5px; line-height: 1.5; color: #3A3F48; font-weight: 600; white-space: nowrap; }
.pp-kpis b { display: block; font-size: 21px; color: #111318; line-height: 1.25; }
.pp-kpis .delta { font-size: 10.5px; }
.paper .acc { grid-template-columns: repeat(6, 1fr); }
.paper .acc div { padding: 8px 10px; background: #F6F4EF; }
.paper .acc b { font-size: 20px; }
.paper .acc span { display: block; font-size: 10px; line-height: 1.3; }
.pp-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pp-charts figure { margin: 0; border: 1px solid #ECE8E1; border-radius: 8px; padding: 10px 10px 8px; }
.pp-charts figcaption { font-size: 11.5px; font-weight: 700; color: #111318; margin-bottom: 6px; }
.pp-charts canvas { width: 330px !important; height: 132px !important; display: block; }
.pp-legend { display: flex; gap: 14px; margin-top: 4px; font-size: 10px; color: #3A3F48; }
.pp-impact { margin: 10px 0 0; font-size: 11.5px; line-height: 1.55; color: #2B2F37; }
.pp-legend i { display: inline-block; height: 3px; width: 12px; border-radius: 2px; vertical-align: 3px; margin-right: 4px; }
.pp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 16px 40px 0; }
.pp-ratios table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pp-ratios th { text-align: right; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: #8A8F98; font-weight: 600; padding: 0 0 5px; }
.pp-ratios td { padding: 6px 0; border-bottom: 1px solid #EFEBE4; text-align: right; font-weight: 600; color: #111318; }
.pp-ratios td:first-child { text-align: left; font-weight: 500; }
.pp-ratios td i { display: block; font-style: normal; font-size: 9px; color: #8A8F98; font-weight: 400; }
.pp-note { font-size: 10px; color: #6B7280; margin: 6px 0 0; }
.paper .mot { gap: 7px; margin-bottom: 6px; }
.paper .mot-row { grid-template-columns: 110px 1fr 24px; font-size: 11.5px; }
.paper .mot-bar { height: 12px; }
.paper .pp-mot .small { font-size: 10px; margin: 0; }
.pp-fb { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.paper .fbx { padding: 8px 10px; }
.paper .fbx p { font-size: 11px; }
.paper .fbx-top b { font-size: 11.5px; }
.paper .fbx-top span, .paper .fbx-top em { font-size: 9.5px; }
.paper .mtags span { font-size: 9px; }
.pp-diag { margin: 16px 40px 0; background: var(--p2-soft); border-left: 4px solid var(--p2); border-radius: 0 8px 8px 0; padding: 14px 18px; }
.pp-diag h3 { border: 0; padding: 0; margin-bottom: 6px; }
.pp-diag p { margin: 0; font-size: 11.5px; line-height: 1.55; color: #111318; white-space: pre-line; }
.pp-foot { position: absolute; left: 40px; right: 40px; bottom: 22px; display: flex; justify-content: space-between; font-size: 10px; color: #8A8F98; border-top: 1px solid #ECE8E1; padding-top: 9px; }

/* ---------- ajustes ---------- */
.aj-head { margin-bottom: 22px; }
.aj-head h1 { font-size: 32px; }
.aj-head p { color: var(--muted); margin: 4px 0 0; }
.g-aj { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.co-list, .fl-list { display: grid; gap: 8px; margin-bottom: 14px; }
.co { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.co-txt { flex: 1; min-width: 0; }
.co-name { width: 100%; border: 0; border-bottom: 1px dashed transparent; font-weight: 600; color: var(--ink); font-size: 14.5px; padding: 2px 0; outline: none; background: transparent; }
.co-name:hover, .co-name:focus { border-bottom-color: var(--line); }
.co-txt span { font-size: 12px; color: var(--muted); }
.sw-in input { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; }
.sw-in input::-webkit-color-swatch-wrapper { padding: 0; }
.sw-in input::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.1); border-radius: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input:not([type=color]), .grid-form input:not([type=file]) { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; outline: none; min-width: 0; width: 100%; }
.inline-form input:focus, .grid-form input:focus { border-color: var(--ink); }
.inline-form input[type=color] { width: 36px; height: 36px; border: 0; padding: 0; background: none; flex: none; }
.fl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.fl b { font-size: 14.5px; color: var(--ink); margin-right: 8px; }
.fl code { font-size: 12px; color: var(--muted); }
.tag { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-form label { display: grid; gap: 5px; }
.grid-form span { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.grid-form .full { grid-column: 1 / -1; }
.grid-form .right { display: flex; justify-content: flex-end; }
.users { display: grid; gap: 10px; }
.users > div { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.users b { display: block; color: var(--ink); font-size: 14.5px; }
.users i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.empty-card { text-align: center; padding: 50px 24px; }
.empty-card h2 { font-size: 26px; margin-bottom: 8px; }
.empty-card p { color: var(--muted); margin: 0 0 20px; }

/* ---------- PDF overlay ---------- */
.gen { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(17,19,24,.55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s ease; }
.gen.in { opacity: 1; }
.gen-card { background: #fff; border-radius: 18px; padding: 30px 40px; text-align: center; box-shadow: var(--shadow-lg); perspective: 600px; }
.gen-card b { display: block; font-size: 17px; color: var(--ink); margin-top: 18px; }
.gen-card span { font-size: 13px; color: var(--muted); }
.gen-paper { width: 70px; height: 92px; margin: 0 auto; border-radius: 5px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 10px 9px; display: grid; gap: 6px; align-content: start; animation: flip 1.4s cubic-bezier(.4,0,.2,1) infinite; transform-style: preserve-3d; }
.gen-paper i { display: block; height: 5px; border-radius: 3px; background: var(--accent, var(--brass)); opacity: .35; }
.gen-paper i:first-child { height: 14px; opacity: 1; background: var(--ink); }
.gen-paper i.s { width: 60%; }
@keyframes flip { 0% { transform: rotateY(0) rotateX(0); } 50% { transform: rotateY(180deg) rotateX(10deg); } 100% { transform: rotateY(360deg) rotateX(0); } }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 14px 13px 16px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; transform: translateY(14px); opacity: 0; transition: transform .3s cubic-bezier(.2,.7,.2,1), opacity .3s ease; }
.toast.in { transform: none; opacity: 1; }
.toast p { margin: 0; flex: 1; }
.toast b { color: #fff; }
.toast button { border: 0; background: rgba(255,255,255,.12); color: #fff; font-weight: 600; font-size: 13px; padding: 7px 11px; border-radius: 8px; white-space: nowrap; }
.toast button:hover { background: rgba(255,255,255,.2); }
.t-dot { width: 8px; height: 8px; border-radius: 50%; background: #3FB37F; flex: none; }
.toast.bad .t-dot { background: #E2654C; } .toast.warn .t-dot { background: #E3A23B; }

/* ---------- responsive (tablet first) ---------- */
@media (max-width: 1280px) {
  .g-semana { grid-template-columns: 1fr; }
  .live-card { position: static; }
  .rep { grid-template-columns: 300px 1fr; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; height: auto; min-height: 100vh; }
  .top > *, .side { min-width: 0; }
  .top { flex-wrap: wrap; padding: 10px 14px; gap: 10px; position: sticky; top: 0; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .tabs button { flex: 1; justify-content: center; }
  .company { width: auto; flex: 1; max-width: 320px; }
  .user { margin-left: auto; }
  .side { overflow: visible; }
  .side-head { padding: 14px 16px 8px; }
  .side-list { display: flex; overflow-x: auto; padding: 0 12px 12px; gap: 8px; }
  .pitem { flex: none; width: 260px; }
  .side-add { display: none; }
  .main { overflow: visible; padding: 20px 16px 50px; }
  .g-evo, .g-aj { grid-template-columns: 1fr; }
  .rep { grid-template-columns: 1fr; }
  .rep-ctrl { position: static; grid-template-columns: repeat(2, 1fr); }
  .login { grid-template-columns: 1fr; grid-template-rows: 34vh 1fr; }
  .lv-copy p { font-size: 22px; }
  .lv-copy { bottom: 22px; }
}
@media (max-width: 680px) {
  .user-txt { display: none; }
  .tabs button { padding: 0 10px; font-size: 13px; }
  .tabs button .ico { display: none; }
  .phead { flex-wrap: wrap; }
  .phead > img { width: 64px; height: 64px; }
  .phead h1 { font-size: 22px; }
  .wsel select { min-width: 0; width: 100%; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  .rep-ctrl { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr; }
  .inline-form { flex-wrap: wrap; }
  .fn-row { grid-template-columns: 80px 1fr 44px 38px; }
  .lv-copy p { font-size: 18px; }
}

/* grid/flex children must be allowed to shrink (wide tables scroll inside their card) */
.main, .view, .g-semana > *, .g-evo > *, .g-aj > *, .rep > *, .rep-ctrl > * { min-width: 0; }

/* ================= v2: fuerza comercial, feedback, acumulados ================= */
.app .serif { font-family: var(--hfont, var(--serif)); }
.inp-nv { background: #FBFAF8; }
.inp-nv .inp-label { color: var(--muted); }
.fb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 22px 0 10px; flex-wrap: wrap; }
.fb-head h3 { font-size: 16px; }
.fb-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); max-width: 520px; }
.fb-list { display: grid; gap: 10px; }
.fb-empty { margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; color: var(--muted); text-align: center; }
.fbi { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; background: #fff; }
.fbi-top { display: grid; grid-template-columns: 190px 150px 1fr 140px 34px; gap: 8px; align-items: center; }
.fbi select, .fbi input { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 14px; background: #fff; outline: none; min-width: 0; width: 100%; }
.fbi select:focus, .fbi input:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--text); transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: #cfc9be; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.lc-gauge { text-align: center; padding: 4px 0 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.lc-gauge canvas { display: block; margin: 0 auto; }
#liveGaugeTxt { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 30px; }
#liveGaugeTxt b { font-size: 26px; color: var(--ink); }
.lc-diag b { display: block; font-size: 14px; color: var(--ink); }
.lc-diag p { margin: 4px 0 0; }

.g-top { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; margin-bottom: 20px; }
.gauge-card .gc-body { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: center; }
.gc-dial { text-align: center; }
.gc-dial canvas { display: block; margin: 0 auto; }
.gc-val { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 2px; }
.gc-val b { font-size: 40px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.parts { display: grid; gap: 12px; }
.part { display: grid; grid-template-columns: 1fr 34px; grid-template-rows: auto 8px; column-gap: 10px; row-gap: 5px; align-items: center; }
.part span { font-size: 13px; color: var(--ink); font-weight: 500; }
.part span i { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
.part b { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-size: 16px; color: var(--ink); }
.pbar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 4px; }
.acc-card { margin-bottom: 20px; }
.acc { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.acc div { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.acc b { display: block; font-size: 24px; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.acc span { font-size: 12px; color: var(--muted); }
.mot { display: grid; gap: 10px; margin-bottom: 10px; }
.mot-row { display: grid; grid-template-columns: 130px 1fr 28px; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); }
.mot-bar { height: 14px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.mot-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.paper .mot-bar i { background: var(--p2); }
.mot-row b { text-align: right; }
.fbx-list { display: grid; gap: 10px; }
.fbx { border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 0 10px 10px 0; padding: 10px 12px; }
.fbx.positiva { border-left-color: var(--good); } .fbx.dudas { border-left-color: var(--warn); } .fbx.negativa { border-left-color: var(--bad); } .fbx.nv { border-left-color: #8A8F98; background: #FAFAF8; }
.fbx-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fbx-top b { font-size: 14px; color: var(--ink); }
.fbx-top span { font-size: 12px; color: var(--muted); }
.fbx-top em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); }
.fbx p { margin: 4px 0 0; font-size: 13.5px; color: var(--text); }
.mtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mtags span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft, #F4ECDE); color: var(--ink); }
.paper .mtags span { background: var(--p2-soft); }
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ref-grid div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ref-grid b { font-size: 20px; color: var(--accent); }
.ref-grid span { display: block; font-weight: 600; color: var(--ink); font-size: 14px; }
.ref-grid i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.zones { display: flex; gap: 8px; flex-wrap: wrap; }
.g-aj .full { grid-column: 1 / -1; }
.grid-form.three { grid-template-columns: repeat(3, 1fr); }
.grid-form .span2 { grid-column: span 2; }
.grid-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; resize: vertical; }
.co-txt { display: grid; gap: 4px; }
.co-addr, .co-font { width: 100%; border: 0; border-bottom: 1px dashed transparent; font-size: 12.5px; color: var(--muted); padding: 2px 0; outline: none; background: transparent; }
.co-addr:hover, .co-addr:focus { border-bottom-color: var(--line); }
.co-font { cursor: pointer; }
@media (max-width: 1280px) { .g-top { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .fbi-top { grid-template-columns: 1fr 1fr; } .acc { grid-template-columns: repeat(3, 1fr); } .gauge-card .gc-body { grid-template-columns: 1fr; } .grid-form.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .acc { grid-template-columns: repeat(2, 1fr); } .grid-form.three { grid-template-columns: 1fr; } .grid-form .span2 { grid-column: auto; } .ref-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .ratio-card { overflow-x: auto; }
  .ratio-card .tbl { margin: 0 -16px; width: calc(100% + 32px); }
  .ratio-card .tbl th:nth-child(2), .ratio-card .tbl td.f { display: none; }
  .ratio-card .tbl th, .ratio-card .tbl td { padding-left: 16px; padding-right: 8px; }
}
@media (max-width: 680px) {
  .phead .ph-txt { flex: 1 1 calc(100% - 82px); }
  .phead .wsel { flex: 1 1 100%; }
  .phead .wsel select { width: 100%; }
}

/* semana nueva y datos que faltan */
.newweek { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); flex-wrap: wrap; }
.newweek b { display: block; color: var(--ink); font-size: 14.5px; }
.newweek span { font-size: 13.5px; color: var(--text); }
.missing { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--bad-soft); color: #7A2A1B; font-size: 14px; animation: pop .2s ease; }
.missing .ico { color: var(--bad); width: 19px; height: 19px; margin-top: 1px; }
.missing b { color: #5E1F13; }

/* confirmacion de semana guardada */
.savedweek { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: 12px; background: var(--good-soft); border: 1px solid #BFDCCB; flex-wrap: wrap; animation: pop .25s ease; }
.savedweek > .ico { width: 26px; height: 26px; color: var(--good); flex: none; }
.savedweek > div:first-of-type { flex: 1; min-width: 220px; }
.savedweek b { display: block; color: #145236; font-size: 15px; }
.savedweek span { font-size: 13.5px; color: #24563F; }
.sw-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* historico compacto: cabe entero en portatil */
.hist-card .tbl { font-size: 13.5px; }
.hist-card .tbl th { padding: 10px 10px; letter-spacing: .04em; font-size: 11px; }
.hist-card .tbl td { padding: 11px 10px; }
.hist-card .tbl th:first-child, .hist-card .tbl td:first-child { padding-left: 22px; }
.hist-card .tbl th:last-child, .hist-card .tbl td:last-child { padding-right: 16px; }

/* ================= aplicacion real: ventanas, usuarios, inmuebles archivados ================= */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(17,19,24,.55); backdrop-filter: blur(3px); animation: pop .18s ease; }
.modal-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; padding: 26px 26px 22px; box-shadow: var(--shadow-lg); display: grid; gap: 4px; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-card h2 { font-size: 24px; margin-bottom: 12px; }
.modal-card .field select { height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; font-size: 15px; }
.modal-card .tg { margin: 4px 0 6px; }
.modal-err { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: #7A2A1B; font-size: 14px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.users > div { flex-wrap: wrap; }
.users > div > div:nth-child(2) { flex: 1; min-width: 180px; }
.users > div.off { opacity: .55; }
.u-btns { display: flex; gap: 6px; }
.side-arch { margin: 0 12px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: inherit; opacity: .7; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.side-arch:hover { opacity: 1; }
.arch { font-weight: 600; }
.ph-top .icon-btn { margin-left: -4px; }
.grid-form .right { display: flex; justify-content: flex-end; gap: 8px; align-items: end; }
.grid-form .tg { align-self: end; padding-bottom: 8px; }
.login-btn:disabled { opacity: .6; }
.login-error { margin: -4px 0 12px; }
.file-pick { position: relative; display: flex; align-items: center; gap: 10px; height: 40px; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick em { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-pick:hover .btn { border-color: var(--ink); }
.tg-field { align-self: end; height: 40px; padding: 0 !important; }
.form-end { display: flex; justify-content: flex-end; gap: 8px; }
.grid-form input[type=date] { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; outline: none; width: 100%; }
.grid-form .note { margin: -4px 0 0; }
.grid-form label.tg-field { display: flex; flex-direction: row; align-items: center; gap: 10px; }
