:root {
    --ink: #16233b;
    --muted: #59677c;
    --line: #dce4ed;
    --blue: #205dde;
    --bg: #f4f7fb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Segoe UI", Arial, sans-serif; }
.site-header { background: white; border-bottom: 1px solid var(--line); }
.header-inner { width: 100%; max-width: 1440px; margin: 0 auto; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-size: 27px; font-weight: 800; letter-spacing: -1px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand span { color: var(--blue); }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: 6px 12px; flex-wrap: wrap; }
a { color: var(--blue); }
.site-nav a { text-decoration: none; font-size: 14px; padding: 10px 4px; }
.site-nav .btn { padding: 10px 14px; }
.menu-toggle { display: none; align-items: center; gap: 8px; background: #e9eef7; color: var(--ink); min-height: 44px; }
main { width: 100%; max-width: 1180px; margin: 32px auto; padding: 0 24px; min-height: 70vh; }
main > *, .grid > *, .formgrid > *, form, fieldset { min-width: 0; }
h1 { font-size: clamp(26px, 4vw, 32px); letter-spacing: -.8px; margin: 0 0 12px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 18px; }
h1, h2, h3, p, a, .tag, .notice, td, summary { overflow-wrap: anywhere; }
p { margin: 8px 0 15px; }
.muted, small { color: var(--muted); }
.hero { padding: 35px 0; }
.hero h1 { font-size: clamp(30px, 5vw, 42px); max-width: 700px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: 0 4px 15px #16233b05; min-width: 0; }
.grid > .card { margin-bottom: 0; }
img, video { max-width: 100%; }
.card img.cover { display: block; width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; }
.tag { display: inline-block; max-width: 100%; background: #eaf0ff; color: #204fad; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.btn, button { border: 0; background: var(--blue); color: white; text-decoration: none; border-radius: 8px; padding: 11px 18px; cursor: pointer; font: 600 14px/1.4 "Segoe UI", sans-serif; display: inline-block; min-height: 44px; max-width: 100%; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.secondary { background: #e9eef7; color: var(--ink); }
.danger { background: #a32835; }
.small { padding: 9px 12px; }
.link { background: transparent; color: var(--blue); padding: 10px 4px; font-weight: 400; }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.actions > * { min-width: 0; }
.notice { background: #eaf1ff; border-left: 4px solid var(--blue); padding: 16px 20px; border-radius: 8px; margin-bottom: 20px; }
.warning { background: #fff5df; border-left-color: #c68215; }
.error, .validation-summary-errors, .field-validation-error { color: #a22231; }
.validation-summary-valid, .field-validation-valid { display: none; }
label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; border: 1px solid #bac8da; border-radius: 8px; padding: 11px; background: white; color: var(--ink); font: 16px/1.4 "Segoe UI", sans-serif; }
input:not([type=checkbox]):not([type=hidden]), select { min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
input[type=file] { padding: 9px; font-size: 14px; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--blue); }
input[type=hidden] { display: none; }
label.check { font-weight: 400; min-height: 44px; padding: 10px 0; margin: 6px 0; }
form.compact { max-width: 520px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.tablewrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: white; }
th, td { text-align: left; padding: 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); }
td a, td .link { display: inline-block; min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
.avatar { width: 90px; height: 90px; object-fit: cover; border-radius: 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
footer { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.auth { max-width: 500px; margin: 32px auto; }
.empty { padding: 30px; border: 1px dashed #bac8da; border-radius: 12px; color: var(--muted); }
details { margin: 18px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 44px; padding: 8px 0; }
:focus-visible { outline: 3px solid #8badff; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9dbbff; outline-offset: 1px; }
@media (max-width: 1100px) {
    .header-inner { gap: 0; padding: 14px 24px; }
    .has-js .menu-toggle { display: inline-flex; }
    .site-nav { width: 100%; flex-direction: column; align-items: stretch; padding-top: 12px; }
    .has-js .site-nav { display: none; }
    .has-js .site-nav.is-open { display: flex; }
    .site-nav a, .site-nav .link { display: block; width: 100%; text-align: left; min-height: 44px; padding: 11px 12px; border-radius: 8px; }
    .site-nav a:hover, .site-nav .link:hover { background: #eaf0ff; }
    .site-nav form { display: block; width: 100%; }
}
@media (max-width: 900px) {
    .grid, .eventos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { padding: 20px; }
}
@media (max-width: 650px) {
    .header-inner { padding: 12px 16px; }
    .brand { font-size: 25px; }
    main { padding: 0 16px; margin: 24px auto; }
    .grid, .eventos-grid, .formgrid { grid-template-columns: minmax(0, 1fr); }
    .grid { gap: 16px; }
    .card { padding: 18px; border-radius: 12px; }
    .card .card { padding: 14px; }
    .hero { padding: 14px 0 24px; }
    .hero h1 { font-size: 30px; }
    .actions { align-items: stretch; }
    .actions > .btn, .actions > button, .actions > form { width: 100%; }
    .actions > form > button { width: 100%; }
    .notice { padding: 14px; }
    .auth { margin: 16px auto; }
    .empty { padding: 20px; }
    /* O JS adiciona os rótulos sem alterar o conteúdo ou os formulários das tabelas. */
    table.mobile-cards, .mobile-cards tbody { display: block; width: 100%; }
    .mobile-cards thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .mobile-cards tbody > tr { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-bottom: 14px; }
    .mobile-cards tbody > tr:last-child { margin-bottom: 0; }
    .mobile-cards td { display: block; width: 100%; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .mobile-cards td:last-child { border-bottom: 0; }
    .mobile-cards td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
    .mobile-cards td:empty { display: none; }
    .mobile-cards td input[type=checkbox] { margin: 6px 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
}
