/* Lifter Anuncios: encima del tema «material» de Radzen. Lo que es propio: la barra de entrega, la vista previa de la
   pantalla de cabina y las filas de anuncios que no salen ahora. */
:root {
    --lifter-accent: #0b5cad;
    --lifter-good: #17703a;
    --lifter-partial: #b7791f;
    --lifter-none: #9aa5b1;
    --lifter-muted: #55606d;
    --lifter-line: #cfd6dd;
}

body { margin: 0; }

.centered { display: grid; place-items: center; min-height: 60vh; font: 16px/1.4 system-ui, sans-serif; }

.brand { color: inherit; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand span { font-weight: 400; }

.dev-mark {
    margin-left: 0.5rem; padding: 0.05rem 0.45rem; border-radius: 999px;
    background: #fdf0d5; color: #855300; font-size: 0.75rem;
}

.page { padding: 1rem 1.5rem 2rem; max-width: 1500px; margin: 0 auto; }

.muted { color: var(--lifter-muted); }
.small { font-size: 0.8rem; }

.title-link { font-weight: 600; color: var(--lifter-accent); text-decoration: none; }
.title-link:hover { text-decoration: underline; }

.only-active { padding-bottom: 0.6rem; }

.failure { margin-bottom: 1rem; }
.failure-message { margin: 0 0 0.5rem; }

/* Filas de anuncios que no salen ahora: caducados en gris, programados en cursiva. */
.row-expired td { opacity: 0.6; }
.row-expired .title-link { text-decoration: line-through; }
.row-scheduled td { font-style: italic; }
.validity { margin-top: 0.2rem; }

/* Entrega: barra y «confirmados/total». */
.delivery { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.delivery-track { width: 70px; height: 8px; border-radius: 4px; background: #e6eaee; overflow: hidden; display: inline-block; }
.delivery-fill { display: block; height: 100%; background: var(--lifter-none); }
.delivery-text { font-variant-numeric: tabular-nums; font-weight: 600; }
.delivery-all .delivery-fill { background: var(--lifter-good); }
.delivery-all .delivery-text { color: var(--lifter-good); }
.delivery-partial .delivery-fill { background: var(--lifter-partial); }
.delivery-partial .delivery-text { color: var(--lifter-partial); }
.delivery-none .delivery-text, .delivery-nodevices .delivery-text { color: var(--lifter-muted); }

/* Alta y edición: campos a la izquierda, vista previa a la derecha. */
.edit-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .edit-columns { grid-template-columns: 1fr; } }
.edit-preview { position: sticky; top: 1rem; }
.content-input { width: 100%; font-family: inherit; }
.counter { margin-left: auto; float: right; font-variant-numeric: tabular-nums; }
.counter.over { color: #bd1e16; font-weight: 700; }
.errors { margin: 0; padding-left: 1.2rem; }

/* La pantalla de cabina: fondo oscuro, título grande, párrafos. */
.kiosk-preview { margin: 0; }
.kiosk-screen {
    aspect-ratio: 16 / 10; overflow: auto; padding: 1.6rem 1.8rem; border-radius: 14px;
    background: linear-gradient(160deg, #0e2238, #12304f); color: #f2f6fa;
    box-shadow: inset 0 0 0 6px #1b1f24, 0 4px 14px rgba(0, 0, 0, 0.25);
}
.kiosk-meta { display: flex; gap: 0.75rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #9fc3e8; margin-bottom: 0.6rem; }
.kiosk-type { font-weight: 700; }
.kiosk-title { margin: 0 0 1rem; font-size: 1.9rem; line-height: 1.15; overflow-wrap: anywhere; }
.kiosk-paragraph { margin: 0 0 0.8rem; font-size: 1.1rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.kiosk-empty { color: #8fa6bd; font-style: italic; }
.kiosk-preview figcaption { margin-top: 0.4rem; font-size: 0.78rem; color: var(--lifter-muted); }
.kiosk-image { display: block; max-width: 100%; max-height: 40%; margin: 0 0 1rem; border-radius: 8px; object-fit: cover; }
.kiosk-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.kiosk-source { font-size: 0.85rem; color: #9fc3e8; }
.kiosk-qr {
    margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem;
    border: 2px dashed #9fc3e8; border-radius: 6px; font-weight: 700; color: #9fc3e8;
}

/* Imagen, enlace y QR en la ficha. */
.image-picker { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.image-thumb { max-width: 12rem; max-height: 8rem; border-radius: 6px; border: 1px solid #d0d7de; object-fit: contain; }
.image-error { color: #bd1e16; }
.short-url { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.short-url code { padding: 0.2rem 0.4rem; background: #eef2f6; border-radius: 4px; user-select: all; }
.scans-table { border-collapse: collapse; }
.scans-table th, .scans-table td { padding: 0.2rem 0.8rem 0.2rem 0; text-align: left; }
.scans-table td.number, .scans-table th.number { text-align: right; font-variant-numeric: tabular-nums; }
.list-icons { display: inline-flex; gap: 0.2rem; vertical-align: middle; color: var(--lifter-muted); font-size: 1rem; }

/* Destino. */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.chip {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.3rem 0.15rem 0.6rem;
    border: 1px solid var(--lifter-line); border-radius: 999px; font-size: 0.85rem; background: #f6f8fa;
}
.chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.25rem; color: var(--lifter-muted); }
.chip-scope { background: #e3effb; border-color: #a9c9ec; font-weight: 600; }
.chip-more { padding-right: 0.6rem; }
.row-chosen td { background: #eef6ff !important; }

/* Entregas. */
.summary-main { display: flex; align-items: center; gap: 0.75rem; }
.summary-label { font-weight: 600; }
.summary-errors { color: #bd1e16; }
.delivery-error { color: #bd1e16; font-size: 0.85rem; }

#blazor-error-ui {
    display: none; position: fixed; inset: auto 0 0 0; z-index: 1000; padding: 0.75rem 1rem;
    background: #fdeae8; color: #17202a; box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
}
#blazor-error-ui .reload { margin-left: 0.75rem; font-weight: 600; }

/* Menú de la cabecera. */
.menu { display: flex; gap: 1rem; }
.menu a { color: inherit; text-decoration: none; opacity: 0.8; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.menu a:hover { opacity: 1; }
.menu a.active { opacity: 1; border-bottom-color: currentColor; }

/* Reparto por regla: una fila por regla, con su número. */
.rule-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--lifter-line); }
.rule-number {
    display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: #e6eef7; color: var(--lifter-accent); font-weight: 700; font-size: 0.85rem;
}
.rule-all, .rule-current { font-size: 0.9rem; }
.rule-list { margin: 0; padding-left: 1.2rem; }
.reach { font-weight: 600; }

/* Campaña (franja y tope), plegada por defecto. */
.campaign { border: 1px solid var(--lifter-line); border-radius: 6px; }
.campaign-header { display: inline-flex; align-items: baseline; gap: 0.6rem; }
.campaign-note { color: #855300; background: #fdf0d5; padding: 0.35rem 0.6rem; border-radius: 4px; }

/* Publicidad en la vista previa: la etiqueta la pone el kiosco. */
.kiosk-ad-label { font-weight: 700; color: #1b1f24; background: #f5c542; padding: 0 0.45rem; border-radius: 3px; }
.kiosk-sponsor { font-weight: 600; text-transform: none; letter-spacing: 0; }

/* Vetos de publicidad. */
.veto-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.4rem 1rem; }

/* Fuentes de noticias */
.menu-count {
    display: inline-block; min-width: 1.3rem; padding: 0 0.35rem; margin-left: 0.25rem; border-radius: 0.65rem;
    background: #f5c542; color: #1b1f24; font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.3rem;
}
.feed-url { max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-direct { color: #855300; font-weight: 600; }
.row-inactive td { opacity: 0.6; }
.source-error { color: #bd1e16; font-size: 0.85rem; margin-top: 0.2rem; }
.source-error summary { cursor: pointer; }
.field-error { color: #bd1e16; margin-top: 0.2rem; }
.refresh-notice { margin-top: 0.2rem; white-space: normal; }
.source-error-full { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0.2rem 0 0 1rem; }
.fetch-ok { color: var(--lifter-good); margin-top: 0.2rem; }
.fetch-failed { color: #bd1e16; margin-top: 0.2rem; }
.direct-warning { color: #855300; font-weight: 600; }
.source-edit { max-width: 52rem; }

/* Bandeja de moderación */
.moderation-list { display: grid; gap: 1rem; }
.moderation-card { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.moderation-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.75rem; margin: 0.75rem 0 0; }
.moderation-facts dt { color: var(--lifter-muted); }
.moderation-facts dd { margin: 0; overflow-wrap: anywhere; }
.moderation-facts .expired { color: #bd1e16; font-weight: 600; }
.moderation-empty { display: flex; align-items: center; gap: 0.6rem; padding: 2rem 0; color: var(--lifter-muted); font-size: 1.05rem; }
.moderation-empty p { margin: 0; }
.moderation-total { font-size: 1rem; font-weight: 400; }
@media (max-width: 800px) { .moderation-card { grid-template-columns: 1fr; } }

/* Banco de imágenes por tema */
.bank-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.bank-topics { display: flex; flex-direction: column; gap: 0.25rem; }
.bank-topic { text-align: left; padding: 0.45rem 0.7rem; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; font: inherit; }
.bank-topic:hover { background: #f3f5f7; }
.bank-topic.selected { background: #e8f0fe; border-color: #b6ccf5; font-weight: 600; }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.bank-card { display: flex; flex-direction: column; gap: 0.3rem; }
.bank-card-inactive { opacity: 0.6; }
.bank-thumb { height: 9rem; display: flex; align-items: center; justify-content: center; background: #f3f5f7; border-radius: 6px; overflow: hidden; }
.bank-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bank-credit { overflow-wrap: anywhere; }
.bank-upload-results { margin: 0; padding-left: 1.2rem; }
.bank-upload-results .upload-uploaded { color: var(--lifter-good); }
.bank-upload-results .upload-alreadythere { color: var(--lifter-muted); }
.bank-upload-results .upload-failed { color: #bd1e16; }
@media (max-width: 800px) { .bank-layout { grid-template-columns: 1fr; } .bank-topics { flex-direction: row; flex-wrap: wrap; } }
