:root {
    --bg: #f7fafc;
    --text: #102033;
    --muted: #64748b;
    --primary: #0369a1;
    --primary-dark: #075985;
    --card: #ffffff;
    --border: #e2e8f0;
    --gold: #d99a21;
    --font-base: system-ui;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-base), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.container.narrow { width: min(860px, calc(100% - 32px)); }
.site-header { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand img { height: 38px; width: auto; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--primary); color: white; font-size: .8rem; }
nav { display: flex; gap: 18px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
nav a:hover { color: var(--primary); }
.hero { padding: 72px 0; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, white), #f8fafc 62%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: center; }
.hero-grid-wide { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); }
.hero h1, .page-heading h1, .cms-hero h1 { font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1.05; margin: 0 0 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--primary); font-weight: 800; font-size: .78rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: var(--primary); color: white; padding: 12px 18px; font-weight: 800; margin-top: 16px; cursor: pointer; }
.button:hover { background: var(--primary-dark); }
.button.full { width: 100%; }
.button-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { background: #f8fafc; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-card, .hero-feature-card { background: var(--card); border: 1px solid var(--border); border-radius: 28px; overflow: hidden; box-shadow: 0 20px 50px rgba(15,23,42,.10); }
.hero-card { padding: 36px; }
.hero-card strong { display: block; font-size: 4rem; line-height: 1; color: var(--primary); }
.hero-panel { width: 100%; }
.hero-feature-card img { width: 100%; height: 400px; object-fit: cover; }
.hero-feature-body { padding: 24px; }
.hero-feature-body h2 { margin: 12px 0; line-height: 1.15; }
.section, .cms-section { padding: 48px 0; }
.cms-section h2, .section-title h2 { margin-top: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.12; }
.cms-image { width: 100%; border-radius: 24px; box-shadow: 0 18px 44px rgba(15,23,42,.12); }
.cms-text { font-size: 1.05rem; color: inherit; }
.columns-text { columns: 2; column-gap: 32px; }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: white; border: 1px solid var(--border); border-radius: 28px; padding: 28px; box-shadow: 0 14px 32px rgba(15,23,42,.06); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.feature-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.mini-feature-card, .card { background: var(--card); border: 1px solid var(--border); overflow: hidden; box-shadow: 0 14px 32px rgba(15,23,42,.06); }
.mini-feature-card { border-radius: 22px; }
.card { border-radius: 24px; }
.mini-feature-card img { width: 100%; height: 240px; object-fit: cover; }
.mini-feature-body, .card-body { padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card img { width: 100%; height: 300px; object-fit: cover; }
.card h2, .card h3 { margin: 10px 0; line-height: 1.2; }
.card p { color: var(--muted); }
.tag { display: inline-flex; border-radius: 999px; background: #e0f2fe; color: var(--primary-dark); font-weight: 800; font-size: .75rem; padding: 5px 10px; }
.image-placeholder { min-height: 240px; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 22px; color: white; background: radial-gradient(circle at 15% 10%, rgba(217,154,33,.85), transparent 28%), radial-gradient(circle at 85% 25%, rgba(3,105,161,.65), transparent 32%), linear-gradient(135deg, #102033, #075985 55%, #0f172a); }
.image-placeholder-large { min-height: 400px; }
.detail-placeholder { min-height: 460px; border-radius: 24px; margin-bottom: 24px; }
.image-placeholder span { width: fit-content; border-radius: 999px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.28); padding: 5px 10px; font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.image-placeholder strong { display: block; font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1.05; }
.page-heading { padding: 56px 0; background: linear-gradient(135deg, #e0f2fe, #ffffff); border-bottom: 1px solid var(--border); }
.filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 12px; margin-bottom: 28px; }
.advanced-filters { grid-template-columns: 1.4fr 1fr 1fr 1fr .9fr .9fr auto; }
.filters input, .filters select { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; font: inherit; background: white; }
.filters button { border: 0; border-radius: 14px; background: var(--text); color: white; padding: 12px 18px; font-weight: 800; cursor: pointer; }
.results-toolbar { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: var(--muted); }
.cards-lista { grid-template-columns: 1fr; }
.cards-lista .card { display: grid; grid-template-columns: 300px 1fr; }
.cards-lista .card img, .cards-lista .image-placeholder { height: 100%; min-height: 220px; }
.cards-horizontal { display: flex; overflow-x: auto; padding-bottom: 18px; scroll-snap-type: x mandatory; }
.cards-horizontal .card { min-width: 360px; scroll-snap-align: start; }
.cards-miniaturas { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cards-miniaturas .card img, .cards-miniaturas .image-placeholder { height: 160px; min-height: 160px; }
.cards-miniaturas .card-body { padding: 14px; }
.cards-miniaturas p { display: none; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; }
.pagination a, .pagination span { border: 1px solid var(--border); background: white; border-radius: 999px; padding: 10px 14px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding: 48px 0; }
.detail-image { border-radius: 24px; margin-bottom: 24px; width: 100%; max-height: 640px; object-fit: cover; }
.content-text, .gallery-block, .detail-aside { background: white; border: 1px solid var(--border); border-radius: 24px; padding: 24px; }
.gallery-block { margin-top: 24px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.gallery-item { margin: 0; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: #fff; }
.gallery-item img { width: 100%; height: 300px; object-fit: cover; }
.gallery-item figcaption { display: grid; gap: 6px; padding: 14px; }
.gallery-item figcaption span { color: var(--muted); font-size: .95rem; }
.detail-aside { height: fit-content; position: sticky; top: 90px; }
dl { margin: 0; }
dt { font-weight: 800; color: var(--muted); margin-top: 12px; }
dd { margin: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); background: white; }
@media (max-width: 980px) { .advanced-filters, .filters { grid-template-columns: 1fr 1fr; } .cards-miniaturas { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) { .hero-grid, .hero-grid-wide, .detail-grid, .feature-strip { grid-template-columns: 1fr; } .cards, .gallery-grid, .cards-lista .card { grid-template-columns: 1fr; } .filters, .advanced-filters { grid-template-columns: 1fr; } .nav-wrap { align-items: flex-start; flex-direction: column; } .detail-aside { position: static; } .columns-text { columns: 1; } .cta-box { display: grid; } }

/* V5 - vistas de programação e aproximação ao portal real */
.extended-filters { grid-template-columns: 1.5fr repeat(7, minmax(110px, 1fr)); }
.events { display: grid; gap: 22px; }
.events-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.events-list { grid-template-columns: 1fr; }
.events-horizontal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.events-thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.event-card { background: var(--card); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; box-shadow: 0 14px 32px rgba(15,23,42,.06); }
.event-media img { width: 100%; height: 260px; object-fit: cover; }
.event-body { padding: 20px; }
.event-body h2 { margin: 10px 0; line-height: 1.2; font-size: 1.25rem; }
.events-list .event-card, .events-horizontal .event-card { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.events-list .event-media img, .events-horizontal .event-media img { height: 100%; min-height: 220px; }
.events-thumbs .event-body p, .events-thumbs .event-body small { display: none; }
.events-thumbs .event-media img, .events-thumbs .image-placeholder { height: 170px; min-height: 170px; }
.events-thumbs .event-body { padding: 14px; }
.events-thumbs .event-body h2 { font-size: 1rem; }
.pagination { display:flex; gap:14px; align-items:center; justify-content:center; margin-top:30px; }
.pagination a { font-weight:800; color: var(--primary); }
.site-real-hero { background: linear-gradient(135deg, #eef7fb, #fff 60%); }
@media (max-width: 900px) { .extended-filters, .events-grid, .events-horizontal, .events-thumbs { grid-template-columns: 1fr; } .events-list .event-card, .events-horizontal .event-card { grid-template-columns: 1fr; } }

/* V7 — homepage tipo slideshow e backoffice visual clean */
.bienal-slideshow {
    min-height: 76vh;
    display: flex;
    align-items: center;
    padding: 72px 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(217,154,33,.24), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #1f2937 52%, #f8fafc 52%, #ffffff 100%);
    color: white;
}
.slideshow-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr); gap: 42px; align-items: center; }
.slideshow-copy h1 { font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: .96; margin: 0 0 18px; max-width: 780px; }
.slideshow-copy p { max-width: 640px; color: rgba(255,255,255,.82); font-size: 1.1rem; }
.slideshow-stage { position: relative; min-height: 520px; }
.slide-card { position: absolute; overflow: hidden; border-radius: 30px; background: white; color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.3); }
.slide-card img, .slide-card .image-placeholder { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.slide-card span, .slide-card strong { position: absolute; left: 18px; right: 18px; z-index: 2; color: white; text-shadow: 0 2px 10px rgba(0,0,0,.55); }
.slide-card span { bottom: 56px; font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.slide-card strong { bottom: 22px; font-size: 1.2rem; line-height: 1.08; }
.slide-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.72)); }
.slide-card-1 { inset: 0 90px 80px 0; }
.slide-card-2 { width: 46%; height: 45%; right: 0; top: 40px; transform: rotate(4deg); }
.slide-card-3 { width: 48%; height: 42%; right: 40px; bottom: 0; transform: rotate(-3deg); }
.slide-card-4 { width: 36%; height: 34%; left: 22px; bottom: 18px; transform: rotate(3deg); }
.admin-visual-heading { background: linear-gradient(135deg, #111827, #243b53); color: white; }
.admin-visual-heading .eyebrow { color: var(--gold); }
.messages { display: grid; gap: 10px; margin-bottom: 18px; }
.message { padding: 12px 16px; border-radius: 14px; background: #e0f2fe; color: #075985; font-weight: 700; }
.message.warning { background: #fef3c7; color: #92400e; }
.message.error { background: #fee2e2; color: #991b1b; }
.event-meta-line { display:flex; gap: 8px; flex-wrap: wrap; align-items:center; }
.status { display:inline-flex; border-radius:999px; padding:5px 10px; font-size:.75rem; font-weight:800; background:#eef2ff; color:#3730a3; }
.status-publicado { background:#dcfce7; color:#166534; }
.status-rejeitado { background:#fee2e2; color:#991b1b; }
.status-submetido, .status-em_revisao { background:#fef3c7; color:#92400e; }
.event-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.event-actions form { display:inline; margin:0; }
.small-button { border: 1px solid var(--border); background:white; border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size:.88rem; cursor:pointer; color:var(--text); }
.small-button.success { background:#16a34a; color:white; border-color:#16a34a; }
.small-button.danger { background:#dc2626; color:white; border-color:#dc2626; }
.small-button.warning { background:#d97706; color:white; border-color:#d97706; }
.events-gestao .event-card { outline: 1px solid rgba(15,23,42,.06); }

@media (max-width: 960px) {
    .bienal-slideshow { background: linear-gradient(135deg, #0f172a, #1f2937); }
    .slideshow-layout { grid-template-columns: 1fr; }
    .slideshow-stage { min-height: 420px; }
    .slide-card-1 { inset: 0 40px 80px 0; }
    .slide-card-2 { right:0; width:42%; }
    .slide-card-3 { right:20px; width:54%; }
}


/* V8 — estrutura final: homepage slideshow, filtros combináveis e histórico */
.home-slideshow-only {
    position: relative;
    min-height: calc(100vh - 70px);
    overflow: hidden;
    background: #0f172a;
}
.home-slideshow-bg {
    position: absolute;
    inset: 0;
}
.home-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: homeSlide 30s infinite;
}
.home-slide-1 { opacity: 1; animation-delay: 0s; }
.home-slide-2 { animation-delay: 6s; }
.home-slide-3 { animation-delay: 12s; }
.home-slide-4 { animation-delay: 18s; }
.home-slide-5 { animation-delay: 24s; }
.home-slide a { display: block; width: 100%; height: 100%; }
.home-slide img,
.home-slide .image-placeholder {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 70px);
    object-fit: cover;
}
.home-slide::after,
.home-slideshow-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15,23,42,.88) 0%, rgba(15,23,42,.58) 42%, rgba(15,23,42,.25) 100%),
        linear-gradient(0deg, rgba(15,23,42,.45), transparent 55%);
    pointer-events: none;
}
.home-slide-caption {
    position: absolute;
    right: 7vw;
    bottom: 7vh;
    width: min(520px, 86vw);
    color: white;
    z-index: 3;
    padding: 24px;
    border-radius: 28px;
    background: rgba(15,23,42,.36);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
}
.home-slide-caption span { font-weight: 900; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; }
.home-slide-caption h2 { font-size: clamp(1.7rem, 3vw, 3rem); margin: 8px 0; line-height: 1.04; }
.home-slide-caption p { margin: 0; color: rgba(255,255,255,.86); }
.home-slideshow-overlay {
    position: relative;
    z-index: 4;
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    color: white;
}
.home-slideshow-overlay h1 {
    font-size: clamp(3rem, 8vw, 7.6rem);
    line-height: .92;
    margin: 0 0 18px;
    max-width: 780px;
    letter-spacing: -.05em;
}
.home-slideshow-overlay p { font-size: 1.15rem; max-width: 620px; color: rgba(255,255,255,.84); }
.home-slideshow-overlay .button-secondary { background: rgba(255,255,255,.12); color: white; border-color: rgba(255,255,255,.35); }

@keyframes homeSlide {
    0%, 18% { opacity: 1; transform: scale(1); }
    22%, 100% { opacity: 0; transform: scale(1.03); }
}

.events-heading { background: linear-gradient(135deg, #f8fafc, #eef7fb); }
.events-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}
.filters-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: 0 12px 30px rgba(15,23,42,.05);
}
.filters-title {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}
.filters-title strong { display: block; font-size: 1.2rem; }
.filters-title span { color: var(--muted); font-size: .92rem; }
.filters-title a { color: var(--primary); font-weight: 800; }
.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.filters-grid label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}
.filters-grid input,
.filters-grid select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: white;
    color: var(--text);
    font: inherit;
}
.filters-panel button {
    margin-top: 16px;
    border: 0;
    border-radius: 16px;
    padding: 13px 18px;
    color: white;
    background: var(--text);
    font-weight: 900;
    cursor: pointer;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: -4px 0 22px;
}
.filter-chips strong { color: var(--muted); font-size: .92rem; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 7px 11px;
    background: #e0f2fe;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: .85rem;
}
.filter-chip.clear { background: #fee2e2; color: #991b1b; }

.history-panel {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 92px;
}
.history-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}
.history-box h3 { margin: 0 0 4px; font-size: 1.2rem; }
.history-box p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.history-box ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.history-box li a { display: block; font-weight: 850; line-height: 1.2; }
.history-box li small { display: block; color: var(--muted); margin-top: 3px; }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}
.stat-card span { display: block; color: var(--muted); font-weight: 800; }
.stat-card strong { display: block; color: var(--primary); font-size: 3rem; line-height: 1; margin-top: 8px; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.dashboard-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 22px;
}
.compact-events .event-card { grid-template-columns: 160px minmax(0, 1fr); }
.compact-events .event-media img,
.compact-events .event-media .image-placeholder { min-height: 150px; height: 100%; }
.compact-events .event-body p { display: none; }

.event-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.status {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .73rem;
    font-weight: 900;
    background: #f1f5f9;
    color: #334155;
}
.status-publicado { background: #dcfce7; color: #166534; }
.status-rejeitado { background: #fee2e2; color: #991b1b; }
.status-submetido, .status-em_revisao { background: #fef3c7; color: #92400e; }
.event-small-info { color: var(--muted); }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.event-actions form { margin: 0; }
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: .84rem;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
}
.small-button.success { background: #dcfce7; color: #166534; }
.small-button.warning { background: #fef3c7; color: #92400e; }
.small-button.danger { background: #fee2e2; color: #991b1b; }

@media (max-width: 1100px) {
    .events-page-layout, .dashboard-grid { grid-template-columns: 1fr; }
    .history-panel { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .history-panel, .dashboard-stats, .filters-grid { grid-template-columns: 1fr; }
    .home-slide-caption { display: none; }
    .home-slideshow-overlay h1 { font-size: clamp(2.5rem, 16vw, 4.4rem); }
}


/* V9 — slideshow editável até 10 slides e estado retirado */
.home-slide { animation-duration: 60s; }
.home-slide-1 { opacity: 1; animation-delay: 0s; }
.home-slide-2 { animation-delay: 6s; }
.home-slide-3 { animation-delay: 12s; }
.home-slide-4 { animation-delay: 18s; }
.home-slide-5 { animation-delay: 24s; }
.home-slide-6 { animation-delay: 30s; }
.home-slide-7 { animation-delay: 36s; }
.home-slide-8 { animation-delay: 42s; }
.home-slide-9 { animation-delay: 48s; }
.home-slide-10 { animation-delay: 54s; }

.status-retirado,
.status-aprovado { background: #e0f2fe; color: #075985; }

.event-card-retirado {
    outline: 2px solid rgba(14, 165, 233, .18);
}

.site-header nav a[href="/backoffice/"] {
    color: var(--primary);
    font-weight: 900;
}

/* polish para o tema escola/cultura */
.page-heading.admin-visual-heading {
    background:
        radial-gradient(circle at 10% 20%, rgba(217,154,33,.18), transparent 26%),
        linear-gradient(135deg, #0f172a, #1f2937);
    color: white;
}
.page-heading.admin-visual-heading p { color: rgba(255,255,255,.76); }
.dashboard-box h2,
.history-box h3,
.filters-title strong {
    letter-spacing: -.02em;
}

.dashboard-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* V10 — gestão visual do slideshow */
.slideshow-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}
.slide-admin-list {
    display: grid;
    gap: 18px;
}
.slide-admin-card {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}
.slide-admin-image img,
.slide-admin-image .image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 310px;
    object-fit: cover;
}
.slide-admin-fields {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
}
.slide-admin-fields label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 800;
    font-size: .9rem;
}
.slide-admin-fields label:nth-child(n+3),
.slide-admin-actions {
    grid-column: 1 / -1;
}
.slide-admin-fields input,
.slide-admin-fields textarea,
.add-slide-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: white;
    color: var(--text);
}
.check-line {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}
.check-line input {
    width: auto !important;
}
.slide-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.add-slide-form {
    display: grid;
    gap: 16px;
}
.add-slide-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}
.help-box {
    margin-top: 22px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--muted);
}
@media (max-width: 1000px) {
    .slideshow-admin-grid,
    .slide-admin-card {
        grid-template-columns: 1fr;
    }
    .slide-admin-image img,
    .slide-admin-image .image-placeholder {
        min-height: 240px;
    }
}

.slide-button { display:inline-flex; margin-top:14px; border-radius:999px; padding:8px 12px; background:rgba(255,255,255,.18); color:white; font-style:normal; font-weight:900; border:1px solid rgba(255,255,255,.28); }


/* V11 — formulários próprios de eventos e equipas */
.bo-event-form {
    width: 100%;
}
.bo-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}
.bo-form-main {
    display: grid;
    gap: 22px;
}
.bo-form-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}
.bo-form-card h2 {
    margin: 0 0 18px;
    letter-spacing: -.02em;
}
.bo-field {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}
.bo-field label,
.data-row label,
.team-form label {
    font-weight: 850;
    color: var(--text);
}
.bo-field small {
    color: var(--muted);
}
.bo-input,
.bo-textarea,
.bo-field select,
.data-row input,
.data-row select,
.data-row textarea,
.team-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    background: white;
    color: var(--text);
}
.bo-textarea {
    min-height: 180px;
    line-height: 1.55;
}
.bo-form-side .sticky-card {
    position: sticky;
    top: 92px;
}
.datas-locais-list {
    display: grid;
    gap: 16px;
}
.data-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #f8fafc;
}
.data-row label {
    display: grid;
    gap: 7px;
}
.data-row label:nth-child(3),
.data-row label:nth-child(6) {
    grid-column: 1 / -1;
}
.teams-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}
.team-form {
    display: grid;
    gap: 18px;
}
.team-users-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-height: 620px;
    overflow: auto;
    padding: 8px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
}
.team-user-checkbox {
    display: flex !important;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
}
.team-user-checkbox input {
    margin-top: 4px;
}
.team-user-checkbox span {
    display: grid;
    gap: 2px;
}
.team-user-checkbox small {
    color: var(--muted);
}
.preview-detail {
    background: var(--bg);
}
.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
}

@media (max-width: 1000px) {
    .bo-form-grid,
    .teams-layout {
        grid-template-columns: 1fr;
    }
    .bo-form-side .sticky-card {
        position: static;
    }
    .team-users-grid {
        grid-template-columns: 1fr;
    }
    .data-row {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   V12 CONVERGIDA — correções finais
   ========================================================= */

/* Slideshow real com JS: sem limite de 10 slides e sem animação CSS rígida */
.home-slideshow-only {
    position: relative;
    min-height: calc(100vh - 70px);
    overflow: hidden;
    background: #0f172a;
}
.home-slideshow-bg {
    position: absolute;
    inset: 0;
}
.home-slide {
    position: absolute !important;
    inset: 0;
    opacity: 0 !important;
    transform: scale(1.02);
    transition: opacity .75s ease, transform 1.2s ease;
    animation: none !important;
    pointer-events: none;
}
.home-slide.is-active {
    opacity: 1 !important;
    transform: scale(1);
    pointer-events: auto;
}
.home-slide img,
.home-slide .image-placeholder {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 70px);
    object-fit: cover;
}
.home-slideshow-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15,23,42,.90) 0%, rgba(15,23,42,.62) 42%, rgba(15,23,42,.22) 100%),
        linear-gradient(0deg, rgba(15,23,42,.46), transparent 60%);
    pointer-events: none;
    z-index: 2;
}
.home-slideshow-overlay {
    position: relative;
    z-index: 5;
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    color: white;
}
.home-slideshow-overlay h1 {
    font-size: clamp(2.8rem, 7vw, 7rem);
    line-height: .94;
    margin: 0 0 18px;
    max-width: 840px;
    letter-spacing: -.05em;
}
.home-slideshow-overlay p {
    font-size: 1.15rem;
    max-width: 720px;
    color: rgba(255,255,255,.86);
}
.slide-meta {
    display: block;
    min-height: 1.3em;
    color: rgba(255,255,255,.72);
    font-weight: 800;
}
.slide-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}
.slide-controls button {
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.12);
    color: white;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
    cursor: pointer;
}
.slide-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.slide-dots button {
    width: 12px;
    height: 12px;
    padding: 0;
    font-size: 0;
    background: rgba(255,255,255,.35);
}
.slide-dots button.is-active {
    background: white;
    width: 32px;
}
.slide-button { 
    display:inline-flex; 
    margin-top:14px; 
    border-radius:999px; 
    padding:8px 12px; 
    background:rgba(255,255,255,.18); 
    color:white; 
    font-style:normal; 
    font-weight:900; 
    border:1px solid rgba(255,255,255,.28); 
}

/* Estados */
.status-retirado { background: #e0f2fe; color: #075985; }
.event-card-retirado { outline: 2px solid rgba(14, 165, 233, .18); }
.slide-admin-card.is-inactive { opacity: .62; }

/* BackOffice slideshow */
.slide-preview-mini {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    background:
        radial-gradient(circle at 12% 20%, rgba(217,154,33,.22), transparent 25%),
        linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
}
.slide-preview-mini span {
    color: var(--gold);
    font-weight: 900;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .1em;
}
.slide-preview-mini h3 { margin: 6px 0; line-height: 1.1; }
.slide-preview-mini p { margin: 0; color: rgba(255,255,255,.78); }

/* Equipas V2 */
.teams-layout-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}
.teams-main {
    display: grid;
    gap: 22px;
}
.team-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}
.team-card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    margin-bottom: 16px;
}
.team-card-head h2 { margin: 8px 0 0; }
.team-card-head p { color: var(--muted); margin: 4px 0 0; }
.team-user-checkbox.is-checked {
    border-color: rgba(3,105,161,.45);
    background: #e0f2fe;
}

/* Mais limpeza no backoffice operacional */
.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
.message {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f1f5f9;
    border: 1px solid var(--border);
    font-weight: 800;
}
.message.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.message.warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.message.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

@media (max-width: 1000px) {
    .teams-layout-v2 { grid-template-columns: 1fr; }
    .team-card-head { flex-direction: column; }
}


/* =========================================================
   PATCH V12+ — Arquivo, Slideshow editorial e BackOffice por abas
   ========================================================= */

/* BackOffice lateral por abas */
.bo-tabs-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}
.bo-tabs-sidebar {
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow: auto;
    background: #0f172a;
    color: white;
    padding: 22px 14px;
    border-right: 1px solid rgba(255,255,255,.08);
}
.bo-tabs-sidebar strong {
    display: block;
    margin: 0 10px 16px;
    color: rgba(255,255,255,.70);
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .14em;
}
.bo-tabs-sidebar a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 14px;
    color: rgba(255,255,255,.76);
    font-weight: 850;
}
.bo-tabs-sidebar a:hover {
    background: rgba(255,255,255,.08);
    color: white;
}
.bo-tabs-sidebar a.active {
    background: white;
    color: #0f172a;
    box-shadow: 0 16px 34px rgba(0,0,0,.22);
}
.bo-tabs-main {
    min-width: 0;
}

/* Abas rápidas dos estados */
.bo-state-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    margin: 0 0 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: white;
}
.bo-state-tabs a {
    border-radius: 999px;
    padding: 9px 14px;
    color: var(--muted);
    font-weight: 900;
}
.bo-state-tabs a.active,
.bo-state-tabs a:hover {
    background: var(--primary);
    color: white;
}

/* Arquivo */
.event-card-retirado,
.event-card-arquivado {
    border-color: rgba(14,165,233,.28);
    background: linear-gradient(180deg,#fff,#f8fbff);
}
.status-retirado,
.status-arquivado {
    background: #e0f2fe;
    color: #075985;
}

/* Slideshow: H1/H2/subtexto e estilos por slide */
.home-slideshow-overlay {
    color: var(--slide-text-color, white);
}
.home-slideshow-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--slide-overlay, transparent);
    pointer-events: none;
    z-index: -1;
}
.home-slideshow-overlay h2,
#slideSubtitle {
    max-width: 820px;
    margin: -6px 0 16px;
    font-size: clamp(1.35rem, 3vw, 2.65rem);
    line-height: 1.08;
    letter-spacing: -.035em;
    color: color-mix(in srgb, var(--slide-text-color, white) 88%, transparent);
}
.slide-text-centro .container {
    text-align: center;
}
.slide-text-centro .hero-actions,
.slide-text-centro .slide-controls {
    justify-content: center;
}
.slide-text-direita .container {
    text-align: right;
}
.slide-text-direita .hero-actions,
.slide-text-direita .slide-controls {
    justify-content: flex-end;
}
.slide-preview-mini small {
    display: block;
    color: rgba(255,255,255,.66);
    font-weight: 800;
    margin-top: 8px;
}
.slide-admin-fields select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: white;
    color: var(--text);
}

@media (max-width: 1000px) {
    .bo-tabs-shell {
        grid-template-columns: 1fr;
    }
    .bo-tabs-sidebar {
        position: static;
        height: auto;
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 12px;
    }
    .bo-tabs-sidebar strong {
        display: none;
    }
    .bo-tabs-sidebar a {
        white-space: nowrap;
        margin: 0;
    }
}
