/* Subastap · Panel de funcionarios. Misma identidad que la app: noche, oro, DM Serif Display + Poppins. */

/* Fuentes en WOFF2 y solo con los caracteres latinos (de ~160 KB a ~9 KB cada Poppins). Los TTF completos están en la app
   (Subastap/Resources/Fonts). Para regenerarlas: pyftsubset <ttf> --unicodes="U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,
   U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2190-2193,U+2212,U+2215" --layout-features='*' --flavor=woff2 */
@font-face { font-family: "Serif"; src: url("fonts/DMSerifDisplay-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
    --bg: #0E0D0B;
    --surface: #171512;
    --surface-2: #1E1B17;
    --surface-3: #26221C;
    --stroke: #2A2621;
    --stroke-strong: #3B362F;
    --text: #F4EFE6;
    --text-2: #B4AB9B;
    --muted: #928A7D; /* Contraste 4.6:1 o más sobre todos los fondos (AA para texto chico). */
    --accent: #D4B06A;
    --accent-rgb: 212 176 106;
    --gold-rgb: 207 165 87;
    --accent-text: #E3C384;
    --accent-soft: rgb(var(--accent-rgb) / .12);
    --gold: linear-gradient(135deg, #F4DCA0 0%, #CFA557 55%, #A27532 100%);
    --on-accent: #1C1508;
    --success: #3FC08C;
    --success-soft: rgba(63, 192, 140, .13);
    --danger: #EF6F61;
    --danger-soft: rgba(239, 111, 97, .13);
    --info: #7FA7F0;
    --info-soft: rgba(127, 167, 240, .13);
    --warning: #F0B45A;
    --warning-soft: rgba(240, 180, 90, .13);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --ease: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --sidebar: 264px;
    color-scheme: dark;
}

/* Colores por sitio: dorado el portal de usuarios (Subastap.Web), azul el panel del equipo y verde el del rematador.
   La clase va en <body> según la ruta (App.razor). */
/* Panel del equipo: azul. */
.theme-staff {
    --accent: #6F9CF2;
    --accent-rgb: 111 156 242;
    --gold-rgb: 79 128 230;
    --accent-text: #9CBDF8;
    --accent-soft: rgb(111 156 242 / .13);
    --gold: linear-gradient(135deg, #B5D0FF 0%, #5E8FEF 55%, #2F5DC2 100%);
    --on-accent: #07142E;
}

/* Panel del rematador (/rematador/...): verde. */
.theme-auctioneer {
    --accent: #4CC79A;
    --accent-rgb: 76 199 154;
    --gold-rgb: 61 190 139;
    --accent-text: #7EDDB8;
    --accent-soft: rgb(76 199 154 / .13);
    --gold: linear-gradient(135deg, #B4F0D6 0%, #3DBE8B 55%, #1E8460 100%);
    --on-accent: #04170F;
}

* { box-sizing: border-box; }
/* Al navegar, Blazor enfoca el título de la página (para lectores de pantalla): sin el recuadro de foco visible. */
h1:focus, [tabindex="-1"]:focus { outline: none; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font-family: "Serif", Georgia, serif; font-size: 34px; letter-spacing: -.01em; }
h2 { font-family: "Serif", Georgia, serif; font-size: 22px; }
h3 { font-size: 15px; font-weight: 600; }
.serif { font-family: "Serif", Georgia, serif; }
.muted { color: var(--muted); }
.secondary { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.overline { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.money { font-family: "Serif", Georgia, serif; color: var(--accent-text); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; }
.between { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Estructura ---------- */

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 22px;
    padding: 24px 16px 18px;
    background: linear-gradient(180deg, #13110E 0%, #0E0D0B 100%);
    border-right: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-tile {
    width: 42px; height: 42px; border-radius: 13px; background: var(--gold);
    display: grid; place-items: center; color: var(--on-accent);
    box-shadow: 0 8px 24px rgb(var(--gold-rgb) / .25);
}
.brand-name { font-family: "Serif", Georgia, serif; font-size: 22px; line-height: 1; }
.brand-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500;
    transition: background .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:active { transform: scale(.98); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a.active::before {
    content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
    background: var(--gold); animation: grow-y .35s var(--spring);
}
.nav .count {
    margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; text-align: center;
    background: var(--danger); color: white; animation: pop .45s var(--spring);
}
.nav .count.gold { background: var(--gold); color: var(--on-accent); }
.nav-section { padding: 0 12px; margin-top: 6px; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.me .grow > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .btn.sm { padding: 6px; flex: none; }
.me { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--stroke); }

.main { min-width: 0; padding: 30px 36px 60px; }
.page { animation: page-in .45s var(--ease) both; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }

/* ---------- Superficies ---------- */

.card {
    background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 20px;
    transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card.hover:hover { border-color: var(--stroke-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; overflow-y: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
@media (max-width: 1100px) { .grid.two { grid-template-columns: minmax(0, 1fr); } }

.stagger > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* ---------- Indicadores ---------- */

.stat { position: relative; overflow: hidden; }
.stat::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, rgb(var(--accent-rgb) / .14), transparent 70%);
}
.stat .value { font-family: "Serif", Georgia, serif; font-size: 36px; line-height: 1.1; margin-top: 8px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .icon-chip { position: absolute; right: 18px; top: 18px; }
.stat.alert .value { color: var(--danger); }
.stat.bump { animation: bump .6s var(--spring); }

.icon-chip { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.icon-chip.success { background: var(--success-soft); color: var(--success); }
.icon-chip.danger { background: var(--danger-soft); color: var(--danger); }
.icon-chip.info { background: var(--info-soft); color: var(--info); }
.icon-chip.warning { background: var(--warning-soft); color: var(--warning); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }

.live { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--stroke); }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on .dot { background: var(--success); }
.live.on .dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--success); animation: ring 1.8s ease-out infinite; }
.live.warn .dot { background: var(--warning); animation: blink 1s ease-in-out infinite; }
.live.off .dot { background: var(--danger); }

/* ---------- Actividad en vivo ---------- */

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--stroke); align-items: flex-start; }
.feed-item:first-child { border-top: 0; }
.feed-item.new { animation: feed-in .6s var(--spring) both, glow 2.4s ease-out both; }
.feed-item .icon-chip { width: 32px; height: 32px; border-radius: 10px; }
.feed-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- Tablas ---------- */

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--stroke); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s var(--ease); animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table tr.flash td { animation: flash 1.6s ease-out; }
.thumb { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--surface-3); flex: none; }
.thumb.lg { width: 100%; height: 220px; border-radius: 14px; }

/* ---------- Formularios ---------- */

.input, .select, .textarea {
    width: 100%; background: var(--surface-2); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 14px; outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .14); background-color: var(--surface-3); }
.textarea { resize: vertical; min-height: 96px; }
.select {
    appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B4AB9B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.select option { background: var(--surface-2); color: var(--text); }
.input.money-input { font-family: "Serif", Georgia, serif; font-size: 18px; }
.search { position: relative; }
.search .input { padding-left: 40px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; color: var(--text-2); }
/* Con texto largo (varias líneas en el celular) el interruptor no se achica ni se corta: queda arriba, alineado a la primera línea. */
.check:has(span.small) { align-items: flex-start; }
.check input { flex: none; appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--stroke-strong); position: relative; cursor: pointer; transition: background .25s var(--ease); }
.check input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .3s var(--spring), background .25s; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: translateX(16px); background: var(--on-accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
    border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; background: var(--surface-3); color: var(--text);
    transition: transform .15s var(--ease), filter .2s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
.btn.primary { background: var(--gold); background-origin: border-box; /* después de "background": si no, el degradado se repite bajo el borde y deja una línea clara abajo */ color: var(--on-accent); box-shadow: 0 8px 22px rgb(var(--gold-rgb) / .22); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(239, 111, 97, .25); }
.btn.success { background: var(--success-soft); color: var(--success); border-color: rgba(63, 192, 140, .25); }
.btn.ghost { background: transparent; border-color: var(--stroke); color: var(--text-2); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn .spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px;
        max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > * { flex-shrink: 0; white-space: nowrap; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 600; cursor: pointer; transition: background .25s var(--ease), color .25s; }
.tabs button.on { background: var(--gold); color: var(--on-accent); }
.tabs .count { margin-left: 6px; font-size: 11px; opacity: .8; }

/* ---------- Diálogos y avisos ---------- */

.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(5, 4, 3, .62); backdrop-filter: blur(6px); animation: fade .25s ease both; }
.dialog { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--stroke-strong); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); animation: dialog-in .4s var(--spring) both; }
.dialog.wide { width: min(980px, 100%); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: 360px; }
.toast { position: relative; overflow: hidden; display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--stroke-strong); box-shadow: var(--shadow); animation: toast-in .5s var(--spring) both; }
.toast.out { animation: toast-out .35s var(--ease) both; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); animation: shrink 5s linear both; }
.toast.error::after { background: var(--danger); }
.toast.success::after { background: var(--success); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .icon-chip { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; }

.skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 40%, var(--surface) 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: zoom-in; transition: transform .25s var(--ease); }
.gallery img:hover { transform: scale(1.04); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--gold); color: var(--on-accent); flex: none; }

/* ---------- Inicio de sesión ---------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 20% 10%, rgb(var(--accent-rgb) / .12), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--stroke); border-radius: 26px; padding: 34px; box-shadow: var(--shadow); animation: dialog-in .6s var(--spring) both; }
.auth-card .brand-tile { width: 62px; height: 62px; border-radius: 19px; animation: logo-in .8s var(--spring) both; }
.error-banner { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 13px; animation: shake .4s ease; }

/* ---------- Animaciones ---------- */

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.04); border-color: var(--accent); } 100% { transform: scale(1); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes ring { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes feed-in { from { opacity: 0; transform: translateX(-18px) scale(.98); } }
@keyframes glow { 0% { background: rgb(var(--accent-rgb) / .16); } 100% { background: transparent; } }
@keyframes flash { 0% { background: rgb(var(--accent-rgb) / .22); } 100% { background: transparent; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
@keyframes shrink { from { width: 100%; } to { width: 0; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes logo-in { 0% { transform: scale(.6) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.menu-toggle { display: none; }

/* Teléfono: el menú lateral pasa a una barra arriba con un botón que lo despliega. */
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { z-index: 30; height: auto; max-height: 100vh; overflow-y: auto; padding: 12px 16px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--stroke); }
    .sidebar .nav, .sidebar .sidebar-foot { display: none; }
    .sidebar.open .nav, .sidebar.open .sidebar-foot { display: flex; }
    .sidebar.open { padding-bottom: 18px; }
    .menu-toggle { display: inline-grid; place-items: center; margin-left: auto; }
    .main { padding: 20px 16px 40px; }
    .table { display: block; overflow-x: auto; }
    .page-head > .row { flex-wrap: wrap; width: 100%; }
    .page-head > .row > * { max-width: 100%; }
    .row > .tabs { min-width: 0; }
}
.text-success { color: var(--success); }
.stat .overline { padding-right: 46px; }

/* ---------- Gráficas ---------- */

.chart { display: flex; align-items: flex-end; gap: 3px; padding-top: 8px; border-bottom: 1px solid var(--stroke); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--gold); opacity: .9; transform-origin: bottom;
       animation: bar-grow .8s var(--spring) both; animation-delay: calc(var(--i, 0) * 14ms); transition: opacity .2s, filter .2s; }
.bar.success { background: linear-gradient(180deg, #6FE0B2, #2E9C70); }
.bar.info { background: linear-gradient(180deg, #A9C6FA, #5C86D8); }
.bar.danger { background: linear-gradient(180deg, #F59A8F, #C9503F); }
.bar-col:hover .bar { opacity: 1; filter: brightness(1.18); }
.chart-x { display: flex; gap: 3px; margin-top: 6px; }
.chart-x span { flex: 1; font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.hbar { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.hbar-track { height: 8px; border-radius: 999px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: var(--gold); animation: bar-x .9s var(--ease) both; transform-origin: left; }
.hbar-fill.info { background: linear-gradient(90deg, #5C86D8, #A9C6FA); }
.hbar-fill.success { background: linear-gradient(90deg, #2E9C70, #6FE0B2); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--gold); display: inline-block; }
.legend i.success { background: var(--success); }
.big-number { font-family: "Serif", Georgia, serif; font-size: 30px; line-height: 1.1; }
.member { display: flex; flex-direction: column; gap: 14px; }
.member .bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
.member .bars div { background: var(--surface-2); border-radius: 12px; padding: 8px 4px; }
.member .bars b { display: block; font-family: "Serif", Georgia, serif; font-size: 20px; font-weight: 400; }
.preview-split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.preview-split div { transition: width .5s var(--spring); }

@keyframes bar-grow { from { transform: scaleY(0); } }
@keyframes bar-x { from { transform: scaleX(0); } }
.chart-wrap { min-width: 0; }

/* Títulos de publicaciones: llevan a su ficha. */
.title-link { display: block; color: var(--text); font-weight: 600; transition: color .15s ease; }
h2 .title-link, .small .title-link { display: inline; }
.title-link:hover { color: var(--accent-text); }

/* Interruptor con texto (avisos). */
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--stroke-strong); border-radius: 14px; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.switch-row:hover { border-color: var(--accent-text); }
.switch-row input { appearance: none; flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--stroke-strong); position: relative; cursor: pointer; transition: background .2s ease; margin-top: 2px; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .25s var(--ease); }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(16px); background: var(--on-accent); }
.stat-mini { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Rematadores ---------- */

.avatar-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; border: 1px solid var(--stroke-strong); }
.avatar-photo.xl { width: 84px; height: 84px; border: 2px solid var(--accent); box-shadow: 0 10px 30px rgb(var(--gold-rgb) / .2); }
.verified-mark { color: var(--info); vertical-align: -3px; filter: drop-shadow(0 0 6px rgba(127, 167, 240, .35)); }
.overline.gold { color: var(--accent-text); }
.spinner-inline { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.upload { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border: 2px dashed var(--stroke-strong);
          border-radius: 16px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; min-width: 0; }
.upload:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload.done { border-style: solid; border-color: rgba(63, 192, 140, .4); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload .tiny { max-width: 100%; }
.upload.compact { flex-direction: row; justify-content: center; padding: 10px 12px; }
.upload-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; animation: pop .4s var(--spring); }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--surface-2);
       color: var(--text); font-size: 12.5px; font-weight: 600; text-align: center; transition: border-color .2s, transform .2s var(--ease); }
.doc:hover { border-color: var(--accent); transform: translateY(-2px); }
.doc img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; }
.doc .icon-chip { width: 64px; height: 64px; border-radius: 18px; }
.doc.missing { opacity: .6; }
.staff-notes { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warning-soft); }
.staff-notes p { margin: 4px 0 0; white-space: pre-line; font-size: 13px; }

.consign-card h2 { font-size: 19px; }
.gallery img.on { outline: 2px solid var(--accent); }
.status-card h2 { font-size: 26px; }

.split-card { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 10px; }
.split-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--stroke); }
.split-row:first-of-type { border-top: 0; padding-top: 0; }
.split-row > .grow { flex-basis: 100%; } /* El escenario ("Si se vende a…") va en su renglón y el desglose debajo; sin esto se achicaba a una palabra por línea. */

.chat-card { display: flex; flex-direction: column; position: sticky; top: 20px; max-height: calc(100vh - 60px); }
.chat { flex: 1; min-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.msg { max-width: 82%; align-self: flex-start; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-3); animation: rise .35s var(--ease) both; }
.msg.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--accent-soft); border: 1px solid rgb(var(--accent-rgb) / .25); }
.msg.proposal { border: 1px solid rgba(127, 167, 240, .35); background: var(--info-soft); }
.msg.system { align-self: center; max-width: 92%; background: transparent; border: 1px dashed var(--stroke-strong); border-radius: 12px; font-size: 12.5px; color: var(--text-2); text-align: center; }
.msg-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--info); margin-bottom: 4px; display: flex; gap: 5px; align-items: center; }
.msg-body { white-space: pre-line; font-size: 13.5px; }
.msg-meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.msg-hidden { display: flex; gap: 6px; align-items: center; font-style: italic; color: var(--muted); font-size: 13px; }
.msg-report { background: none; border: 0; padding: 0 0 0 6px; color: var(--muted); cursor: pointer; vertical-align: middle; opacity: .7; }
.msg-report:hover, .msg-report:focus-visible { color: var(--danger); opacity: 1; }
.msg.reported { outline: 2px solid var(--danger); outline-offset: 2px; }
.msg.hidden-msg .msg-body { opacity: .65; text-decoration: line-through; }
.report-quote { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--stroke-strong, var(--stroke)); background: var(--surface-2); border-radius: 0 10px 10px 0; white-space: pre-line; font-size: 13.5px; color: var(--text-2, inherit); max-height: 160px; overflow-y: auto; }
.image-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.image-editor .tile { position: relative; border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.image-editor .tile.cover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.image-editor .tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.image-editor .tile .tools { display: flex; justify-content: space-between; gap: 4px; padding: 6px; }
.image-editor .tile .badge { position: absolute; top: 8px; left: 8px; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--stroke); }
.chat-input .textarea { min-height: 52px; }

.auth-card.wide-card { width: min(900px, 100%); }
.auth-alt { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--stroke); flex-wrap: wrap; }
.apply-steps { margin: 6px 0 4px; padding-left: 20px; color: var(--text-2); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.share-text { font-size: 13.5px; line-height: 1.55; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 14px; }
.share-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 14px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--stroke); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600;
    transition: transform .15s var(--ease), border-color .2s var(--ease);
}
.share-btn:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.share-btn .icon-chip b { font-size: 15px; }
.icon-chip.whatsapp { background: rgba(37, 211, 102, .14); color: #3DDC84; }
.icon-chip.facebook { background: rgba(24, 119, 242, .16); color: #5B9BF5; }
.icon-chip.x { background: rgba(255, 255, 255, .08); color: var(--text); }
.icon-chip.linkedin { background: rgba(10, 102, 194, .18); color: #4A9BE4; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 24px 0 10px; }

/* ---------- Reconexión con el servidor (App.razor + reconnect.js) ---------- */
#components-reconnect-modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); margin: 16vh auto 0; overflow: visible; }
#components-reconnect-modal::backdrop { background: rgba(5, 4, 3, .55); backdrop-filter: blur(5px); }
#components-reconnect-modal[open] { animation: dialog-in .45s var(--spring) both; }
.reconnect-card { width: 340px; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
                  padding: 26px 24px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--stroke-strong); box-shadow: var(--shadow); }
.reconnect-card b { font-size: 16px; }
.reconnect-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.reconnect-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.reconnect-alert { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.reconnect-card .btn { margin-top: 6px; min-width: 150px; }
/* Cada parte se ve solo en su estado (Blazor pone la clase en el diálogo). */
#components-reconnect-modal [data-state] { display: none; }
#components-reconnect-modal.components-reconnect-show [data-state~=show],
#components-reconnect-modal.components-reconnect-retrying [data-state~=retrying],
#components-reconnect-modal.components-reconnect-failed [data-state~=failed],
#components-reconnect-modal.components-reconnect-paused [data-state~=paused],
#components-reconnect-modal.components-reconnect-resume-failed [data-state~=expired] { display: block; }
#components-reconnect-modal.components-reconnect-failed .btn[data-state~=failed],
#components-reconnect-modal.components-reconnect-paused .btn[data-state~=paused],
#components-reconnect-modal.components-reconnect-resume-failed .btn[data-state~=expired] { display: inline-flex; }
#components-reconnect-modal.components-reconnect-failed .reconnect-alert[data-state~=failed],
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-alert[data-state~=expired] { display: grid; }
/* Mientras reintenta, Blazor deja también la clase "show": se oculta el texto del primer intento. */
#components-reconnect-modal.components-reconnect-retrying [data-state=show] { display: none; }

/* ---------- Desplegable propio (Dropdown.razor) ---------- */
.dropdown { position: relative; min-width: 0; }
.dropdown-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--stroke); border-radius: 12px; padding: 10px 14px; color: var(--text); font: inherit;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.dropdown-toggle:hover { border-color: var(--stroke-strong); }
.dropdown-toggle:focus-visible, .dropdown.open .dropdown-toggle { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background-color: var(--surface-3); }
.dropdown-toggle:disabled { opacity: .5; cursor: default; }
.dropdown-chevron { flex: none; color: var(--text-2); transition: transform .2s var(--ease); }
.dropdown.open .dropdown-chevron { transform: rotate(180deg); }
.dropdown-backdrop { position: fixed; inset: 0; z-index: 40; }
.dropdown-list {
    position: absolute; z-index: 41; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
    max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface-2); border: 1px solid var(--stroke-strong); border-radius: 14px; box-shadow: var(--shadow);
    animation: dropdown-in .16s var(--ease) both; transform-origin: top;
    scrollbar-width: thin; scrollbar-color: var(--stroke-strong) transparent;
}
.dropdown-list::-webkit-scrollbar { width: 8px; }
.dropdown-list::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 8px; border: 2px solid var(--surface-2); }
.dropdown-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px;
    cursor: pointer; color: var(--text-2); font-size: 13.5px;
}
.dropdown-list li.active { background: var(--surface-3); color: var(--text); }
.dropdown-list li.selected { color: var(--accent-text); font-weight: 600; }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px) scaleY(.97); } to { opacity: 1; transform: none; } }

.info-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }

/* Pujas en el panel del rematador */
.table.compact td, .table.compact th { padding: 8px 10px; }
.table tr.muted-row td { opacity: .55; }
.badge .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 4px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Fotos de un bien propio del rematador (alta desde el panel): la primera es la portada. */
.photo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-slot { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-3); animation: pop .4s var(--spring); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot .badge { position: absolute; left: 8px; top: 8px; }
.photo-actions { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s var(--ease); }
.photo-slot:hover .photo-actions, .photo-slot:focus-within .photo-actions { opacity: 1; }
.photo-actions .btn { background: var(--surface); padding: 5px 7px; }
.upload.photo-add { aspect-ratio: 1; justify-content: center; padding: 10px; }
.upload.photo-add.busy { opacity: .6; pointer-events: none; }
@media (hover: none) { .photo-actions { opacity: 1; } }

/* Mientras Blazor arranca no hay animaciones de entrada (las saca reconnect.js): evita el parpadeo al recargar. */
html.booting *, html.booting *::before, html.booting *::after { animation: none !important; }

/* Remate en cámara (prueba de concepto) */
.badge.live-badge { background: #e5484d; color: #fff; }
.badge.live-badge .dot { background: #fff; }
.badge.live-badge.pending { background: var(--surface-3); color: var(--text-2); }
.badge.live-badge.pending .dot { background: var(--muted); }
.live-card .card-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.studio { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } }
.studio-video { position: relative; aspect-ratio: 16 / 9; background: #0b0b0f; border-radius: 14px; overflow: hidden; }
.studio-video video { width: 100%; height: 100%; object-fit: cover; }
.studio-video .overlay { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; }
.studio-video .price { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; padding: 8px 12px; border-radius: 10px; }
.studio-video .price b { font-size: 22px; }
.studio-clock { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; }
.paddle { display: inline-grid; place-items: center; min-width: 34px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.floor-sale { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--stroke); }
.live-fields { margin-top: 12px; }
