/* ===== Portal da escola — tema inspirado no portal do AE Idães ===== */
:root {
  --brand: #eb1d87;            /* cor de destaque: menu ativo, ligações, botões (Definições → Cor principal) */
  --title: #a22b2b;            /* títulos das notícias (Definições → Cor dos títulos) */
  --link: #0345bf;             /* paginação, lista "mais notícias", contactos do rodapé */
  --brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 8%, #fff);
  --text: #252525;
  --body: #686868;
  --muted: #858585;
  --bg: #f5f5f5;
  --surface: #fff;
  --border: #ccc;
  --line: #e8e8e8;
  --dark: #171717;
  --ok: #1f7a3d;
  --warn: #9a6200;
  --danger: #b42318;
  --radius: 4px;
  --shadow: 0 3px 5px rgba(0, 0, 0, .2);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 80px;
  /* Coluna lateral: largura, espaço entre caixas, margem interior e altura máxima dos logótipos */
  --side-width: 270px;
  --side-gap: 16px;
  --side-pad: 16px;
  --side-img: 46px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; color: var(--text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { max-width: 1170px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 200; }
.skip:focus { left: 8px; }

/* ---------- Botões e etiquetas ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1.2em; border: 1px solid var(--brand); border-radius: var(--radius);
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, #fff); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: .3em .7em; font-size: .875rem; }
.btn-block { width: 100%; }

.badge { display: inline-block; padding: .1em .55em; border-radius: 99px; font-size: .78rem; font-weight: 600; vertical-align: middle; }
.badge-ok { background: #e3f4e8; color: var(--ok); }
.badge-warn { background: #fdf1d8; color: var(--warn); }
.badge-muted { background: #eceff3; color: var(--muted); }
.badge-accent { background: var(--brand-soft); color: var(--brand-dark); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 16px; border: 1px solid; }
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-success { background: #e9f7ee; border-color: #b7e2c4; color: #14532d; }
.alert-error { background: #fdecea; border-color: #f5c2bc; color: #7a1a12; }
.alert-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, #fff); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: #fff;
  border-bottom: 1px solid var(--line); transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; flex: none; }
.brand-logo { height: 60px; width: auto; }
.brand-badge {
  flex: none; width: 60px; height: 60px; display: grid; place-items: center;
  border: 2px solid var(--text); color: var(--text); font-weight: 700; font-size: 1.3rem; letter-spacing: .5px;
}
.brand-name { font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: .9rem; line-height: 1.2; max-width: 200px; }

.nav-toggle { display: none; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; justify-content: flex-end; white-space: nowrap; }
.menu > li { position: relative; display: flex; align-items: center; }
.menu > li > a {
  position: relative; display: block; padding: 0 16px; line-height: var(--header-h);
  color: var(--text); font-weight: 600; text-transform: uppercase; letter-spacing: 1.14px;
}
.menu > li.has-sub > a { padding-right: 30px; }
.menu > li.has-sub > a::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.menu > li > a::before {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px;
  background: var(--text); transform: scaleX(0); transition: transform .2s;
}
.menu > li > a:hover, .menu > li > a[aria-current] { color: var(--brand); }
.menu > li > a[aria-current]::before { transform: scaleX(1); width: 24px; right: auto; }
.sub-toggle { display: none; }
.submenu {
  list-style: none; margin: 0; padding: 20px; position: absolute; top: 100%; left: 0; min-width: 250px;
  background: #fff; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s;
}
.submenu li { position: relative; }
.submenu a { display: block; padding: 6px 0; color: var(--text); white-space: normal; }
.submenu a:hover, .submenu a[aria-current] { color: var(--brand); }
.submenu li.has-sub > a { padding-right: 18px; }
.submenu li.has-sub > a::after {
  content: ""; position: absolute; right: 2px; top: 15px; width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg);
}
/* 3.º nível: abre ao lado */
.submenu .submenu { top: -20px; left: calc(100% + 20px); }
.menu li:hover > .submenu, .menu li:focus-within > .submenu { opacity: 1; visibility: visible; transform: none; }

/* ---------- Grande título esbatido (página inicial) ---------- */
.big-title { padding: 20px 0 40px; text-align: center; overflow: hidden; }
.big-title p {
  margin: 0; font-size: clamp(1.6rem, .8rem + 2.88vw, 2.8rem); font-weight: 600; line-height: 1.1;
  text-transform: uppercase; color: rgba(154, 143, 143, .22); white-space: nowrap;
}

.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.page-title { color: var(--title); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); font-weight: 700; margin: 0 0 24px; }

/* ---------- Layout principal: conteúdo + coluna lateral ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-width); gap: 30px; align-items: start; padding-bottom: 60px; }
.content { min-width: 0; }

/* ---------- Blogue (página inicial): imagem a flutuar e texto a contorná-la ---------- */
/* Separador a meio: 14px + os 16px com que acaba cada notícia (texto, "Ler mais" ou imagem) = os 30px abaixo da linha. */
.blog-item { display: flow-root; margin-bottom: 14px; color: var(--body); }
.blog-item + .blog-item { padding-top: 30px; border-top: 1px solid var(--line); }
.blog-item h2 { font-size: 1.3125rem; font-weight: 700; margin: 0 0 20px; }
.blog-item h2 a, .article-title { color: var(--title); }
.blog-item h2 a:hover { color: var(--brand); }
.intro-image { display: block; width: 50%; margin: 0 0 16px; }
.intro-image.pos-right { float: right; margin-left: 30px; }
.intro-image.pos-left { float: left; margin-right: 30px; }
.intro-image.pos-full { width: 100%; margin: 0 0 24px; }
.intro-image img { width: 100%; transition: opacity .2s; }
.intro-image:hover img { opacity: .9; }
.intro { line-height: 1.5; }
.intro p, .intro div { margin: 0 0 1em; }
.intro > :last-child { margin-bottom: 16px; }
.intro img { max-width: 100%; }
.readmore { margin: 0 0 16px; }
.readmore a { color: #42464a; }
.readmore a:hover { color: var(--brand); }
.video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 24px; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Miniatura do vídeo e janela grande */
.video-thumb { position: relative; display: block; background: #000; }
.video-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px;
  border-radius: 10px; background: rgba(0, 0, 0, .7); transition: background .15s;
}
.video-play::after {
  content: ""; position: absolute; left: 26px; top: 12px;
  border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff;
}
.video-thumb:hover .video-play, .video-thumb:focus-visible .video-play { background: #f00; }
.video-lightbox { width: min(92vw, 1100px); max-width: none; padding: 0; border: 0; background: #000; overflow: visible; }
.video-lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.video-lightbox iframe { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 85vh; border: 0; }
.video-close {
  position: absolute; right: 0; top: -44px; width: 40px; height: 40px; padding: 0;
  border: 0; background: none; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer;
}

/* Carrossel de imagens */
.carousel { position: relative; background: var(--bg); }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; }
.carousel-slide a { display: block; }
.carousel-slide img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0 0 3px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.carousel-nav:hover { background: rgba(0, 0, 0, .8); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; pointer-events: none; }
.carousel-dot { width: 10px; height: 10px; padding: 0; border: 1px solid #fff; border-radius: 50%; background: rgba(0, 0, 0, .35); cursor: pointer; pointer-events: auto; }
.carousel-dot[aria-current] { background: #fff; }

/* Capa no formulário da notícia */
.cover-panel { border: 1px solid var(--line); }
.cover-panel legend { font-weight: 600; color: var(--text); font-size: .95rem; }
.cover-option { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cover-option[hidden] { display: none; }
.gallery-edit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gallery-edit li { display: grid; gap: 6px; align-content: start; }
.gallery-edit img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); }

.edit-bar { margin: 0 0 14px; }
.edit-page { padding-bottom: 60px; }

/* Lista "mais notícias" depois do blogue */
.more-list { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid rgba(0, 0, 0, .125); }
.more-list li { padding: 12px 20px; border-top: 1px solid rgba(0, 0, 0, .125); }
.more-list li:first-child { border-top: 0; }
.more-list a { color: var(--link); }
.more-list a:hover { text-decoration: underline; }

/* Paginação em blocos */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pagination a, .pagination span { padding: 11px 17px; background: #f1f1f1; color: var(--muted); line-height: 1; }
.pagination a:hover { background: #e2e2e2; color: var(--text); }
.pagination span[aria-current] { background: var(--link); color: #fff; }

/* ---------- Notícia e página ---------- */
.article { color: var(--body); }
.article-title { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.125rem); font-weight: 700; line-height: 1.2; margin: 0 0 20px; }
.article-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .9rem; margin-bottom: 30px; }
.article-info strong { color: var(--text); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--link); color: #fff; font-weight: 700; margin-right: -8px; }
.article-image { margin: 0 0 30px; }
.article-image img { width: 100%; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: .9rem; }
.share a { padding: 6px 14px; color: #fff; border-radius: 3px; }
.share a:hover { color: #fff; opacity: .85; }
.share-fb { background: #3b5998; }
.share-x { background: #111; }
.share-wa { background: #25d366; }
.share-mail { background: #777; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }
.pager a { padding: 10px 20px; border: 1px solid var(--border); color: var(--text); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; font-size: .85rem; }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager-next { margin-left: auto; }
.lead { font-size: 1.15rem; color: var(--text); }
.prose { overflow-wrap: break-word; line-height: 1.6; }
.prose h2 { font-size: 1.4rem; margin-top: 1.4em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.2em; }
.prose blockquote { margin: 1em 0; padding: .4em 1em; border-left: 3px solid var(--brand); background: var(--bg); }
.prose img { margin: 1em 0; }
.prose .ql-align-center, .prose .align-center { text-align: center; }
.prose .ql-align-right, .prose .align-right { text-align: right; }
.prose .ql-align-justify, .prose .align-justify { text-align: justify; }
.prose img.align-center, .prose .align-center > img { margin-left: auto; margin-right: auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
.prose table ul { margin: 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin: 1em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.prose hr.readmore-break { display: none; }
.side-block .prose { font-size: .875rem; line-height: 1.45; }
.side-block .prose p { margin: 0 0 .6em; }
.side-block img { margin: 0 auto 8px; }
.related { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.2rem; }
.related ul { padding-left: 1.1em; }
.related li { margin-bottom: 6px; }
.related small { color: var(--muted); }
.tile-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile-list a { display: block; padding: 14px 18px; border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.tile-list a:hover { border-color: var(--brand); color: var(--brand); }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
.contact-card { border: 1px solid var(--border); padding: 30px; color: var(--body); }
.contact-card h2 { font-size: 1.1rem; color: var(--title); }
.map { margin-top: 30px; }
.map iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ---------- Coluna lateral ---------- */
.sidebar { display: grid; gap: var(--side-gap); }
.side-box { border: 1px solid var(--border); padding: var(--side-pad); }
.side-title { font-size: .9rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .6em; }
.side-title a { color: var(--text); }
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--body); font-size: .9rem; line-height: 1.3; }
.side-nav li:last-child a { border-bottom: 0; }
.side-nav a:hover, .side-nav a[aria-current] { color: var(--brand); }
.side-nav a[aria-current] { font-weight: 600; }
.side-user { display: grid; gap: 8px; }
.side-user p { margin: 0; }
.side-user-name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.side-user-info { font-size: .85rem; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.side-search form { display: flex; }
.side-search input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--border); border-right: 0; font: inherit; font-size: .875rem; }
.side-search input:focus { outline: none; border-color: var(--brand); }
.side-search button { padding: 0 10px; border: 0; background: var(--brand); color: #fff; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
.side-search button:hover { background: var(--brand-dark); }

.quick-grid, .logo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: center; }
.quick-grid a, .quick-grid li > span {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  color: var(--text); font-weight: 600; font-size: .95rem; line-height: 1.2; transition: transform .15s;
}
.quick-grid a:hover { transform: scale(1.05); color: var(--brand); }
.quick-icon { font-size: 1.7rem; line-height: 1; }
.quick-grid .has-img img, .logo-grid img { max-height: var(--side-img); width: auto; margin: 0 auto; object-fit: contain; }
.logo-grid a { display: block; transition: opacity .15s; }
.logo-grid a:hover { opacity: .8; }

/* ---------- Rodapé ---------- */
.site-bottom { background: var(--dark); color: #bbb; padding: 50px 0 15px; font-size: .8rem; }
.site-bottom a { color: var(--link); }
.site-bottom a:hover { color: #fff; }
.bottom-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px 40px; }
.bottom-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.bottom-logo { height: 60px; width: auto; background: #fff; padding: 4px; }
.bottom-partner { height: 60px; width: auto; max-width: 160px; object-fit: contain; background: #fff; padding: 6px 10px; }
.bottom-contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 24px; max-width: 640px; }
.bottom-contacts li.full { flex-basis: 100%; text-align: right; }
.bottom-contacts span { filter: grayscale(1) brightness(1.8); }
.bottom-note { text-align: center; font-size: .85rem; color: #888; margin-top: 24px; }
.site-footer { background: var(--dark); border-top: 1px solid rgba(255, 255, 255, .08); color: var(--muted); font-size: .875rem; padding: 24px 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; }
.footer-menu a { color: var(--muted); text-transform: uppercase; }
.footer-menu a:hover { color: #fff; }
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 40px; height: 40px; display: grid; place-items: center;
  background: rgba(0, 0, 0, .35); color: #fff; border-radius: 4px; opacity: 0; visibility: hidden; transition: .2s; z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--brand); color: #fff; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.form label small { font-weight: 400; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .form textarea, .form select, .inline-search input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: #fff; color: var(--text);
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 16px; display: grid; gap: 12px; }
.form legend { padding: 0 6px; color: var(--muted); font-size: .9rem; }
.form-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.form-main, .form-side { display: grid; gap: 14px; }
.narrow-form { max-width: 520px; }
.thumb { max-height: 160px; border: 1px solid var(--border); object-fit: cover; }
.thumb-contain { object-fit: contain; background: var(--bg); padding: 8px; }
.form textarea[data-editor] { min-height: 420px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }

/* ---------- Login / instalação ---------- */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.auth-box { width: 100%; max-width: 440px; background: var(--surface); padding: 32px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.auth-box h1 { font-size: 1.6rem; margin-bottom: .2em; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 11px 16px;
  border: 1px solid #dadce0; border-radius: var(--radius); background: #fff; color: #3c4043;
  font: 500 1rem/1.2 var(--font); transition: background .15s, box-shadow .15s;
}
.btn-google:hover { background: #f8faff; color: #3c4043; box-shadow: 0 1px 3px rgba(60, 64, 67, .3); }
.auth-note { font-size: .85rem; margin: 10px 0 0; }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 20px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- Administração ---------- */
body.admin { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--dark); color: #c9c9c9; padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.admin-brand { color: #fff; font-weight: 700; line-height: 1.3; padding: 0 8px; }
.admin-brand small { display: block; color: #999; font-weight: 400; }
.admin-side nav { display: grid; gap: 2px; }
.admin-side nav a { color: #c9c9c9; padding: 8px 10px; border-radius: var(--radius); }
.admin-side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-side nav a[aria-current] { background: var(--brand); color: #fff; }
.admin-side form { margin-top: auto; }
.admin-side .btn-ghost { color: #c9c9c9; border-color: rgba(255, 255, 255, .25); width: 100%; }
.admin-side .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-main { padding: 24px clamp(16px, 3vw, 40px) 48px; }
.admin-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-top h1 { margin: 0; font-size: 1.6rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.panel h2 { font-size: 1.1rem; margin: 0; }
.pending-panel { margin-bottom: 16px; border-color: var(--brand); }
.pending-panel select { padding: 4px 6px; font: inherit; font-size: .875rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar p { margin: 0; }
.inline-search { display: flex; gap: 8px; }
.inline-search input { width: 240px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
form.inline { display: inline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat strong { display: block; font-size: 1.9rem; color: var(--brand); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
.table th.right, .table td.right { text-align: right; }
.table tr:last-child td { border-bottom: 0; }
.table td.indent { padding-left: 32px; }
.table tr.dim td { opacity: .6; }
.table a { font-weight: 600; }
.icon-cell { font-size: 1.3rem; width: 56px; }
.icon-cell img { max-height: 32px; width: auto; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Ecrãs médios e pequenos ---------- */
@media (max-width: 1260px) {
  .menu > li > a { padding: 0 10px; letter-spacing: .6px; font-size: .95rem; }
  .menu > li.has-sub > a { padding-right: 24px; }
  .menu > li.has-sub > a::after { right: 9px; }
  .menu > li > a::before { left: 10px; }
  .brand-name { display: none; }
}
@media (max-width: 1100px) {
  :root { --header-h: 70px; }
  .brand-logo, .brand-badge { height: 50px; }
  .brand-badge { width: 50px; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px;
    padding: 10px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--text); transition: .2s; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .1); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav-open .main-nav { display: block; }
  .menu { flex-direction: column; padding: 8px 16px 16px; white-space: normal; }
  .menu > li > a { font-size: 1rem; letter-spacing: 1px; }
  .menu > li { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .menu > li > a { flex: 1; line-height: 1.4; padding: 12px 0; }
  .menu > li.has-sub > a { padding-right: 0; }
  .menu > li.has-sub > a::after, .menu > li > a::before { display: none; }
  .sub-toggle { display: block; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
  .sub-toggle::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -6px 0 0 -4px;
    border: solid var(--text); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s;
  }
  .has-sub.open .sub-toggle::after { transform: rotate(-135deg); margin-top: -1px; }
  .submenu { position: static; width: 100%; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 10px 14px; }
  .submenu .submenu { left: auto; top: auto; }
  .submenu li { display: flex; flex-wrap: wrap; align-items: center; }
  .submenu li > a { flex: 1; }
  .submenu li.has-sub > a::after { display: none; }
  .menu li:hover > .submenu, .menu li:focus-within > .submenu { display: none; }
  .menu li.open > .submenu { display: block; }

  .layout { grid-template-columns: 1fr; }
  .big-title { padding: 14px 0 24px; }
  .big-title p { white-space: normal; }

  .form-cols { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
  .intro-image.pos-right, .intro-image.pos-left { float: none; width: 100%; margin: 0 0 20px; }
  .bottom-grid { justify-content: center; }
  .bottom-logos, .bottom-contacts { justify-content: center; }
  .bottom-contacts li.full { text-align: center; }
  .inline-search, .inline-search input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
