:root {
    --cnd-accent: #f2b705;
    --cnd-border: rgba(16,24,40,.12);
    --cnd-fill-accent: linear-gradient(180deg,#34c77b 0%,#14603f 100%);
    --cnd-fill-header: linear-gradient(180deg,#34c77b 0%,#14603f 100%);
    --cnd-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cnd-font-size: 14px;
    --cnd-inset-top: inset 0 1px 0 rgba(255,255,255,.28);
    --cnd-ko: #dc3545;
    --cnd-lift: translateY(-1px);
    --cnd-ok: #198754;
    --cnd-pad-x: .7rem;
    --cnd-pad-y: .5rem;
    --cnd-primary: #34c77b;
    --cnd-primary-strong: #14603f;
    --cnd-radius: 8px;
    --cnd-shadow-card: 0 10px 24px rgba(16,24,40,.13), 0 2px 4px rgba(16,24,40,.08);
    --cnd-shadow-hover: 0 6px 16px rgba(16,24,40,.2);
    --cnd-surface: #ffffff;
    --cnd-surface-2: #f7f8fa;
    --cnd-text: #1d2939;
    --cnd-text-muted: #667085;
    --cnd-transition: box-shadow .15s ease, transform .15s ease;
    --cnd-warn: #c98a06;
    --cnd-zebra: rgba(16,24,40,.025);
}

/* Portal theme — static rules.
 *
 * This file is NOT part of any asset bundle. It is read and served by
 * /cnd_portal_theme/theme.css, together with the `:root` block that carries
 * the values. That is what makes the on/off switch real: with the theme off
 * the page gets no stylesheet at all, instead of one that has to be undone.
 *
 * There is not a single colour, radius or shadow written down here. Every
 * value goes through a `var(--cnd-*)`, so the whole look is decided once, in
 * Python, when the variables are built. Flat vs raised and solid vs gradient
 * never reach this file.
 */

/* ── Base ─────────────────────────────────────────────────────────────── */

.o_portal,
.o_portal_wrap,
main.o_portal_wrap {
    font-family: var(--cnd-font-family);
    font-size: var(--cnd-font-size);
    color: var(--cnd-text);
}

.o_portal_wrap a:not(.btn) {
    color: var(--cnd-primary-strong);
}

.o_portal_wrap a:not(.btn):hover {
    color: var(--cnd-primary);
}

.o_portal_wrap h1,
.o_portal_wrap h2,
.o_portal_wrap h3,
.o_portal_wrap h4,
.o_portal_wrap h5,
.o_portal_wrap h6 {
    color: var(--cnd-text);
}

.o_portal_wrap .text-muted {
    color: var(--cnd-text-muted) !important;
}

/* ── Tables ───────────────────────────────────────────────────────────── */

/* Bootstrap paints cell backgrounds with a 9999px inset box-shadow, which
   sits on top of anything set with `background`. Resetting that state
   variable is what lets the gradients show through. */
.o_portal_wrap .table > :not(caption) > * > * {
    --bs-table-bg-state: transparent;
    box-shadow: none;
    padding: var(--cnd-pad-y) var(--cnd-pad-x);
    border-color: var(--cnd-border);
    vertical-align: middle;
}

.o_portal_wrap .table {
    color: var(--cnd-text);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--cnd-radius);
    overflow: hidden;
    background: var(--cnd-surface);
    box-shadow: var(--cnd-shadow-card);
}

.o_portal_wrap .table > thead > tr > th,
.o_portal_wrap .table > thead > tr > td {
    background: var(--cnd-fill-header);
    color: #fff;
    border: 0;
    font-size: .8em;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: var(--cnd-inset-top);
}

.o_portal_wrap .table > tbody > tr {
    transition: var(--cnd-transition);
}

.o_portal_wrap .table > tbody > tr:nth-child(even) > * {
    background: var(--cnd-zebra);
}

.o_portal_wrap .table > tbody > tr:hover {
    transform: var(--cnd-lift);
    box-shadow: var(--cnd-shadow-hover);
}

/* ── Cards and panels ─────────────────────────────────────────────────── */

.o_portal_wrap .card {
    background: var(--cnd-surface);
    color: var(--cnd-text);
    border-color: var(--cnd-border);
    border-radius: var(--cnd-radius);
    box-shadow: var(--cnd-shadow-card);
    transition: var(--cnd-transition);
}

.o_portal_wrap .card:hover {
    box-shadow: var(--cnd-shadow-hover);
}

.o_portal_wrap .card-header {
    background: var(--cnd-surface-2);
    border-bottom-color: var(--cnd-border);
    color: var(--cnd-text);
}

.o_portal_wrap .list-group-item {
    background: var(--cnd-surface);
    border-color: var(--cnd-border);
    color: var(--cnd-text);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.o_portal_wrap .btn {
    border-radius: var(--cnd-radius);
    transition: var(--cnd-transition);
}

.o_portal_wrap .btn-primary {
    background: var(--cnd-fill-accent);
    border-color: var(--cnd-primary-strong);
    box-shadow: var(--cnd-inset-top);
}

/* Texto blanco en todo botón de fondo lleno, y dicho aquí en vez de confiado
   a Bootstrap: el fondo lo pone la paleta, así que el contraste del texto es
   responsabilidad de este fichero. Quedan fuera `btn-light` y `btn-warning`,
   que son claros y necesitan texto oscuro. */
.o_portal_wrap .btn-primary,
.o_portal_wrap .btn-primary:hover,
.o_portal_wrap .btn-primary:focus,
.o_portal_wrap .btn-primary:active,
.o_portal_wrap .btn-success,
.o_portal_wrap .btn-danger,
.o_portal_wrap .btn-dark {
    color: #fff;
}

.o_portal_wrap .btn-primary:hover,
.o_portal_wrap .btn-primary:focus {
    background: var(--cnd-primary-strong);
    border-color: var(--cnd-primary-strong);
    transform: var(--cnd-lift);
    box-shadow: var(--cnd-shadow-hover);
}

.o_portal_wrap .btn-secondary,
.o_portal_wrap .btn-light {
    background: var(--cnd-surface-2);
    border-color: var(--cnd-border);
    color: var(--cnd-text);
}

.o_portal_wrap .btn-outline-primary {
    border-color: var(--cnd-primary);
    color: var(--cnd-primary-strong);
}

.o_portal_wrap .btn-outline-primary:hover {
    background: var(--cnd-fill-accent);
    border-color: var(--cnd-primary-strong);
    color: #fff;
}

/* ── Badges and chips ─────────────────────────────────────────────────── */

.o_portal_wrap .badge {
    border-radius: 999px;
    box-shadow: var(--cnd-inset-top);
}

.o_portal_wrap .badge.text-bg-primary,
.o_portal_wrap .badge.bg-primary {
    background: var(--cnd-fill-accent) !important;
}

.o_portal_wrap .badge.text-bg-success,
.o_portal_wrap .badge.bg-success {
    background: var(--cnd-ok) !important;
}

.o_portal_wrap .badge.text-bg-danger,
.o_portal_wrap .badge.bg-danger {
    background: var(--cnd-ko) !important;
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.o_portal_wrap .form-control,
.o_portal_wrap .form-select {
    background: var(--cnd-surface);
    color: var(--cnd-text);
    border-color: var(--cnd-border);
    border-radius: var(--cnd-radius);
}

.o_portal_wrap .form-control:focus,
.o_portal_wrap .form-select:focus {
    border-color: var(--cnd-primary);
    /* The focus ring is the one place the accent earns its keep: it has to be
       visible against the base tint, which a lighter primary would not be. */
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--cnd-accent) 45%, transparent);
}

/* ── Alerts ───────────────────────────────────────────────────────────── */

.o_portal_wrap .alert {
    border-radius: var(--cnd-radius);
    border-color: var(--cnd-border);
    box-shadow: var(--cnd-shadow-card);
}

/* ── Navigation: breadcrumbs, sidebar, pagination ─────────────────────── */

.o_portal_wrap .breadcrumb {
    background: transparent;
}

.o_portal_wrap .breadcrumb .breadcrumb-item a {
    color: var(--cnd-primary-strong);
}

.o_portal_wrap .o_portal_sidebar .card,
.o_portal_wrap #sidebar_content .card {
    box-shadow: var(--cnd-shadow-card);
}

.o_portal_wrap .page-link {
    color: var(--cnd-primary-strong);
    border-color: var(--cnd-border);
    background: var(--cnd-surface);
}

.o_portal_wrap .page-item.active .page-link {
    background: var(--cnd-fill-accent);
    border-color: var(--cnd-primary-strong);
    color: #fff;
}

/* ── Progress bars ────────────────────────────────────────────────────── */

.o_portal_wrap .progress {
    background: var(--cnd-zebra);
    border-radius: 999px;
}

.o_portal_wrap .progress-bar {
    background: var(--cnd-fill-accent);
}

/* ── Modules that opt in ──────────────────────────────────────────────── */

/* Tables that already style themselves — the quiniela match table is the
   first — read the same variables with their own value as a fallback, so they
   follow the palette here and look untouched where the theme is not
   installed. Nothing of theirs needs to be repeated in this file. */
