/*
 * Tema da Central Ebenezer TV sobre o Django Admin.
 * As cores ficam em variáveis (claro e escuro); o resto do ficheiro só as usa.
 */

/* ── Cores ─────────────────────────────────────────────────────── */
:root,
html[data-theme="light"] {
  --eb-navy: #081226;
  --eb-orange: #e85500;
  --eb-orange-hover: #cf4900;
  --eb-blue: #1565e0;
  --eb-cyan: #2ab8c8;

  --eb-page: #f4f6fa;
  --eb-surface: #ffffff;
  --eb-surface-2: #f8fafc;
  --eb-line: #e6e9ef;
  --eb-text: #0f172a;
  --eb-muted: #64748b;
  --eb-soft-orange: #fff1e8;
  --eb-soft-blue: #eaf1fd;
  --eb-soft-green: #e8f7ef;
  --eb-soft-red: #fdecec;
  --eb-green: #15803d;
  --eb-red: #c62828;
  --eb-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -8px rgba(15, 23, 42, 0.08);

  /* Django admin */
  --primary: var(--eb-blue);
  --secondary: var(--eb-navy);
  --accent: var(--eb-orange);
  --primary-fg: #fff;
  --body-fg: var(--eb-text);
  --body-bg: var(--eb-surface);
  --body-quiet-color: var(--eb-muted);
  --body-medium-color: #334155;
  --body-loud-color: #020617;
  --header-color: #cbd5e1;
  --header-branding-color: #fff;
  --header-bg: var(--eb-navy);
  --header-link-color: #fff;
  --breadcrumbs-fg: var(--eb-muted);
  --breadcrumbs-link-fg: var(--eb-blue);
  --breadcrumbs-bg: var(--eb-surface);
  --link-fg: var(--eb-blue);
  --link-hover-color: #0d3fa6;
  --link-selected-fg: var(--eb-orange);
  --hairline-color: var(--eb-line);
  --border-color: #d5dae3;
  --error-fg: var(--eb-red);
  --message-success-bg: var(--eb-soft-green);
  --message-warning-bg: #fff8e6;
  --message-error-bg: var(--eb-soft-red);
  --darkened-bg: var(--eb-surface-2);
  --selected-bg: #eef2f7;
  --selected-row: var(--eb-soft-orange);
  --button-fg: #fff;
  --button-bg: #1e293b;
  --button-hover-bg: #0f172a;
  --default-button-bg: var(--eb-orange);
  --default-button-hover-bg: var(--eb-orange-hover);
  --close-button-bg: #64748b;
  --close-button-hover-bg: #334155;
  --delete-button-bg: var(--eb-red);
  --delete-button-hover-bg: #a51f1f;
  --object-tools-fg: #fff;
  --object-tools-bg: var(--eb-navy);
  --object-tools-hover-bg: #1e293b;
  --font-family-primary: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --eb-page: #070c18;
    --eb-surface: #0d1526;
    --eb-surface-2: #111b2f;
    --eb-line: #1e2a40;
    --eb-text: #e2e8f0;
    --eb-muted: #94a3b8;
    --eb-soft-orange: #2b1608;
    --eb-soft-blue: #0f2244;
    --eb-soft-green: #0b2a1a;
    --eb-soft-red: #2f0f12;
    --eb-green: #4ade80;
    --eb-red: #f87171;
    --eb-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

    --primary: #2b74e8;
    --body-medium-color: #cbd5e1;
    --body-loud-color: #fff;
    --header-bg: #050a14;
    --breadcrumbs-link-fg: #7fb0ff;
    --link-fg: #7fb0ff;
    --link-hover-color: #a9c9ff;
    --border-color: #2a3852;
    --message-warning-bg: #2e2205;
    --selected-bg: #16223a;
    --button-bg: #24324d;
    --button-hover-bg: #31446a;
    --close-button-bg: #334155;
    --close-button-hover-bg: #475569;
    --object-tools-bg: #24324d;
    --object-tools-hover-bg: #31446a;
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --eb-page: #070c18;
  --eb-surface: #0d1526;
  --eb-surface-2: #111b2f;
  --eb-line: #1e2a40;
  --eb-text: #e2e8f0;
  --eb-muted: #94a3b8;
  --eb-soft-orange: #2b1608;
  --eb-soft-blue: #0f2244;
  --eb-soft-green: #0b2a1a;
  --eb-soft-red: #2f0f12;
  --eb-green: #4ade80;
  --eb-red: #f87171;
  --eb-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

  --primary: #2b74e8;
  --body-fg: var(--eb-text);
  --body-bg: var(--eb-surface);
  --body-quiet-color: var(--eb-muted);
  --body-medium-color: #cbd5e1;
  --body-loud-color: #fff;
  --header-bg: #050a14;
  --breadcrumbs-fg: var(--eb-muted);
  --breadcrumbs-link-fg: #7fb0ff;
  --breadcrumbs-bg: var(--eb-surface);
  --link-fg: #7fb0ff;
  --link-hover-color: #a9c9ff;
  --hairline-color: var(--eb-line);
  --border-color: #2a3852;
  --error-fg: var(--eb-red);
  --message-success-bg: var(--eb-soft-green);
  --message-warning-bg: #2e2205;
  --message-error-bg: var(--eb-soft-red);
  --darkened-bg: var(--eb-surface-2);
  --selected-bg: #16223a;
  --selected-row: var(--eb-soft-orange);
  --button-bg: #24324d;
  --button-hover-bg: #31446a;
  --close-button-bg: #334155;
  --close-button-hover-bg: #475569;
  --object-tools-bg: #24324d;
  --object-tools-hover-bg: #31446a;
  color-scheme: dark;
}

/* ── Base ──────────────────────────────────────────────────────── */
html,
body {
  background: var(--eb-page);
}

body {
  font-size: 0.875rem;
  -webkit-font-smoothing: antialiased;
  color: var(--eb-text);
}

a:link,
a:visited {
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--eb-orange);
  outline-offset: 2px;
}

#content {
  padding: 28px 32px 48px;
}

#content > h1,
#content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--body-loud-color);
  margin: 0 0 20px;
}

#content > h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--body-medium-color);
}

/* ── Cabeçalho ─────────────────────────────────────────────────── */
#header {
  /* #container is a flex column: without this the header shrinks below its content on long pages */
  flex-shrink: 0;
  min-height: 64px;
  padding: 0 32px;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

#branding .eb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

#branding .eb-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

#branding .eb-brand strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

#branding .eb-brand small {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eb-orange);
}

#user-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

#user-tools strong {
  color: #fff;
  font-weight: 600;
}

#user-tools a,
#user-tools #logout-form button {
  border: 0;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

#user-tools a:hover,
#user-tools a:focus,
#user-tools #logout-form button:hover,
#user-tools #logout-form button:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

#user-tools a.eb-warn {
  color: #fdba74;
}

/* Hide the "/" separators between the links */
#user-tools {
  font-size: 0;
}

#user-tools > *,
#user-tools a,
#user-tools button {
  font-size: 0.8rem;
}

.theme-toggle svg.theme-icon-when-auto,
.theme-toggle svg.theme-icon-when-dark,
.theme-toggle svg.theme-icon-when-light {
  fill: #cbd5e1;
  color: var(--header-bg);
  height: 1.25rem;
  width: 1.25rem;
}

/* ── Migalhas (breadcrumbs) ────────────────────────────────────── */
div.breadcrumbs {
  padding: 12px 32px;
  background: var(--eb-surface);
  border-bottom: 1px solid var(--eb-line);
  color: var(--eb-muted);
  font-size: 0.8rem;
}

div.breadcrumbs a {
  color: var(--breadcrumbs-link-fg);
  font-weight: 500;
}

/* ── Menu lateral ──────────────────────────────────────────────── */
#nav-sidebar {
  background: var(--eb-surface);
  border-right: 1px solid var(--eb-line);
  padding: 16px 12px 32px;
}

#nav-filter {
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--eb-line);
  border-radius: 10px;
  background: var(--eb-surface-2);
  color: var(--eb-text);
}

#nav-sidebar .module {
  margin-bottom: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#nav-sidebar .module caption {
  padding: 6px 10px;
  background: transparent;
  border: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#nav-sidebar .module caption a.section,
#nav-sidebar .module caption a.section:link,
#nav-sidebar .module caption a.section:visited {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--eb-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

#nav-sidebar .module caption a.section::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--eb-icon, none) center / contain no-repeat;
  mask: var(--eb-icon, none) center / contain no-repeat;
}

#nav-sidebar .current-app caption a.section {
  color: var(--eb-orange);
}

#nav-sidebar tr,
#nav-sidebar .module th,
#nav-sidebar .module td {
  border: 0;
  padding: 0;
  background: transparent;
}

#nav-sidebar .module th a {
  display: block;
  padding: 7px 10px 7px 33px;
  border-radius: 8px;
  color: var(--body-medium-color);
  font-weight: 500;
  font-size: 0.85rem;
}

#nav-sidebar .module th a:hover {
  background: var(--eb-surface-2);
  color: var(--body-loud-color);
}

#nav-sidebar .current-model {
  background: transparent;
}

#nav-sidebar .current-model th a {
  background: var(--eb-soft-orange);
  color: var(--eb-orange);
  font-weight: 600;
}

/* The add links are on each list page; the menu stays clean */
#nav-sidebar .addlink {
  display: none;
}

.toggle-nav-sidebar {
  background: var(--eb-page);
  border-right: 1px solid var(--eb-line);
  color: var(--eb-muted);
}

.toggle-nav-sidebar:hover,
.toggle-nav-sidebar:focus {
  background: var(--eb-surface-2);
}

/* ── Cartões (módulos) ─────────────────────────────────────────── */
.module,
#content-main > form > div > fieldset.module,
.inline-group {
  background: var(--eb-surface);
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  box-shadow: var(--eb-shadow);
  overflow: hidden;
}

.module h2,
.module caption,
.inline-group h2 {
  padding: 12px 16px;
  background: var(--eb-surface-2);
  border-bottom: 1px solid var(--eb-line);
  color: var(--body-loud-color);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.module caption a.section {
  color: var(--body-loud-color);
}

fieldset.module {
  margin-bottom: 20px;
}

/* ── Tabelas ───────────────────────────────────────────────────── */
thead th,
tfoot td {
  background: var(--eb-surface-2);
  color: var(--eb-muted);
  border-bottom: 1px solid var(--eb-line);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

thead th a:link,
thead th a:visited {
  color: var(--eb-muted);
}

td,
th {
  border-bottom: 1px solid var(--eb-line);
  padding: 10px 12px;
  line-height: 1.45;
  vertical-align: middle;
}

#result_list tbody tr:hover td,
#result_list tbody tr:hover th {
  background: var(--eb-surface-2);
}

#result_list tbody tr.selected td,
#result_list tbody tr.selected th {
  background: var(--selected-row);
}

#result_list th a {
  font-weight: 600;
}

/* ── Lista (changelist) ────────────────────────────────────────── */
#changelist .changelist-form-container {
  background: var(--eb-surface);
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  box-shadow: var(--eb-shadow);
  overflow: hidden;
}

#changelist .changelist-form-container > div,
#changelist .changelist-form-container > form {
  min-width: 0;
}

#changelist #toolbar {
  padding: 12px 16px;
  background: var(--eb-surface);
  border-bottom: 1px solid var(--eb-line);
}

#changelist #toolbar form input[type="text"],
#changelist #toolbar form #searchbar {
  box-sizing: border-box;
  height: 38px;
  width: min(360px, 100%);
  padding: 6px 12px;
  border-radius: 10px;
  vertical-align: middle;
}

#changelist #toolbar form input[type="submit"] {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
  background: var(--eb-surface-2);
  color: var(--body-loud-color);
  vertical-align: middle;
}

#changelist #toolbar form input[type="submit"]:hover {
  border-color: var(--eb-orange);
}

#changelist .actions {
  padding: 10px 16px;
  background: var(--eb-surface-2);
  border-bottom: 1px solid var(--eb-line);
  color: var(--eb-muted);
}

#changelist .actions select {
  border-radius: 8px;
  padding: 4px 8px;
}

#changelist .paginator {
  padding: 12px 16px;
  margin: 0;
  border-top: 0;
  background: var(--eb-surface);
  color: var(--eb-muted);
}

.paginator a:link,
.paginator a:visited {
  background: var(--eb-surface-2);
  border: 1px solid var(--eb-line);
  border-radius: 8px;
  color: var(--body-medium-color);
  padding: 4px 10px;
}

.paginator a.showall {
  border: 0;
  background: transparent;
  color: var(--link-fg);
}

.paginator .this-page {
  background: var(--eb-orange);
  color: #fff;
  border-radius: 8px;
  padding: 4px 10px;
}

#changelist .toplinks {
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--eb-line);
  background: var(--eb-surface);
}

#changelist .toplinks a {
  font-weight: 600;
}

/* Filtros */
#changelist-filter {
  background: var(--eb-surface);
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  box-shadow: var(--eb-shadow);
  overflow: hidden;
}

#changelist-filter h2 {
  padding: 12px 16px;
  background: var(--eb-surface-2);
  border-bottom: 1px solid var(--eb-line);
  color: var(--body-loud-color);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: none;
}

#changelist-filter h3,
#changelist-filter details summary {
  color: var(--body-loud-color);
  font-weight: 600;
}

#changelist-filter li.selected a {
  color: var(--eb-orange);
  font-weight: 600;
}

#changelist-filter li.selected {
  border-left-color: var(--eb-orange);
}

#changelist-filter a {
  color: var(--body-medium-color);
}

#changelist-filter a:hover {
  color: var(--link-fg);
}

/* Booleanos (sim/não) mais discretos */
img[src$="icon-yes.svg"],
img[src$="icon-no.svg"],
img[src$="icon-unknown.svg"] {
  width: 15px;
  height: 15px;
}

/* ── Botões ────────────────────────────────────────────────────── */
.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.15s, transform 0.15s;
}

.button.default,
input[type="submit"].default,
.submit-row input.default {
  text-transform: none;
  letter-spacing: 0;
  background: var(--default-button-bg);
  box-shadow: 0 6px 16px -8px rgba(232, 85, 0, 0.7);
}

.button:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.submit-row {
  padding: 14px 16px;
  margin: 20px 0 0;
  background: var(--eb-surface);
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  box-shadow: var(--eb-shadow);
  align-items: center;
}

.submit-row a.deletelink {
  border-radius: 10px;
  padding: 9px 16px;
}

/* Ferramentas do objecto ("Adicionar", "Histórico", "Enviar notificação") */
.object-tools {
  margin-top: -54px;
}

.object-tools a:link,
.object-tools a:visited {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.object-tools a.addlink {
  background-color: var(--eb-orange);
  background-position: 12px center;
  padding-left: 30px;
}

.object-tools a.addlink:hover,
.object-tools a.addlink:focus {
  background-color: var(--eb-orange-hover);
}

/* ── Formulários ───────────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[type="search"],
textarea,
select,
.vTextField,
.vURLField {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--eb-surface);
  color: var(--eb-text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select {
  height: auto;
  min-height: 38px;
  line-height: 1.3;
  padding-right: 28px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--eb-orange);
  box-shadow: 0 0 0 3px rgba(232, 85, 0, 0.15);
}

/* Fields already show the orange ring above */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

.form-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--eb-line);
}

.aligned label {
  color: var(--body-medium-color);
  font-weight: 600;
}

.aligned label.required::after,
label.required::after {
  color: var(--eb-orange);
}

div.help,
p.help,
form .help {
  color: var(--eb-muted);
  font-size: 0.78rem;
}

.readonly {
  color: var(--body-medium-color);
}

fieldset .fieldBox {
  margin-right: 24px;
}

/* ── Avisos ────────────────────────────────────────────────────── */
ul.messagelist li {
  margin: 0 0 10px;
  padding: 12px 16px 12px 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background-position: 16px center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--eb-text);
}

ul.messagelist li.success {
  border-color: rgba(21, 128, 61, 0.25);
}

ul.messagelist li.warning {
  border-color: rgba(202, 138, 4, 0.3);
}

ul.messagelist li.error {
  border-color: rgba(198, 40, 40, 0.3);
}

p.errornote,
.errornote {
  border: 1px solid rgba(198, 40, 40, 0.3);
  border-radius: 12px;
  background: var(--eb-soft-red);
  color: var(--eb-red);
  padding: 12px 16px;
  font-weight: 500;
}

ul.errorlist li {
  border-radius: 8px;
  background: var(--eb-soft-red);
}

/* ── Login ─────────────────────────────────────────────────────── */
html:has(> body.login) {
  background: var(--eb-navy);
}

body.login {
  box-sizing: border-box;
  min-height: 100vh;
  padding: 72px 0 32px;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(21, 101, 224, 0.35), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(232, 85, 0, 0.25), transparent 70%),
    var(--eb-navy);
}

.login #container {
  width: min(420px, calc(100% - 32px));
  min-width: 0;
  margin: 0 auto;
  border: 0;
  border-radius: 20px;
  background: var(--eb-surface);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.login #header {
  display: none;
}

.login #content {
  padding: 36px 32px 32px;
}

.login .eb-login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login .eb-login-brand img {
  width: 150px;
  height: auto;
}

.login .eb-login-brand h1 {
  margin: 16px 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--body-loud-color);
}

.login .eb-login-brand p {
  margin: 0;
  color: var(--eb-muted);
  font-size: 0.85rem;
}

.login .form-row {
  padding: 0 0 16px;
  border: 0;
}

.login .form-row label {
  display: block;
  margin-bottom: 6px;
  color: var(--body-medium-color);
  font-weight: 600;
  font-size: 0.8rem;
}

.login .form-row #id_username,
.login .form-row #id_password,
.login .form-row #id_code {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.login .eb-code summary {
  cursor: pointer;
  margin-bottom: 12px;
  color: var(--link-fg);
  font-size: 0.8rem;
  font-weight: 600;
}

.login .submit-row {
  padding: 8px 0 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login .submit-row input {
  width: 100%;
  height: 46px;
  font-size: 0.95rem;
  background: var(--eb-orange);
  box-shadow: 0 10px 24px -10px rgba(232, 85, 0, 0.8);
}

.login .submit-row input:hover {
  background: var(--eb-orange-hover);
}

.login .eb-login-foot {
  margin-top: 20px;
  text-align: center;
  color: var(--eb-muted);
  font-size: 0.75rem;
}

/* ── Visão geral ───────────────────────────────────────────────── */
.dashboard #content {
  width: auto;
  max-width: 1320px;
}

.eb-ico {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--eb-icon) center / contain no-repeat;
  mask: var(--eb-icon) center / contain no-repeat;
}

.eb-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eb-eyebrow {
  margin: 0 0 6px;
  color: var(--eb-orange);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#content h1.eb-title {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.eb-lead {
  margin: 6px 0 0;
  color: var(--eb-muted);
  font-size: 0.95rem;
}

.eb-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

a.eb-qa:link,
a.eb-qa:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--eb-line);
  border-radius: 999px;
  background: var(--eb-surface);
  color: var(--body-loud-color);
  font-weight: 600;
  font-size: 0.8rem;
  box-shadow: var(--eb-shadow);
  transition: border-color 0.15s, transform 0.15s;
}

a.eb-qa:hover {
  border-color: var(--eb-orange);
  transform: translateY(-1px);
}

a.eb-qa .eb-ico {
  width: 16px;
  height: 16px;
  color: var(--eb-orange);
}

a.eb-qa.eb-primary:link,
a.eb-qa.eb-primary:visited {
  border-color: var(--eb-orange);
  background: var(--eb-orange);
  color: #fff;
}

a.eb-qa.eb-primary .eb-ico {
  color: #fff;
}

.eb-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(232, 85, 0, 0.35);
  border-radius: 14px;
  background: var(--eb-soft-orange);
  color: var(--eb-text);
}

.eb-alert .eb-ico {
  width: 22px;
  height: 22px;
  color: var(--eb-orange);
}

.eb-alert p {
  margin: 0;
  flex: 1;
}

.eb-alert a.eb-qa {
  flex: none;
}

.eb-section-title {
  margin: 28px 0 12px;
  color: var(--eb-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.eb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  background: var(--eb-surface);
  box-shadow: var(--eb-shadow);
  color: var(--eb-text);
  min-width: 0;
}

a.eb-card:link,
a.eb-card:visited {
  color: var(--eb-text);
  transition: border-color 0.15s, transform 0.15s;
}

a.eb-card:hover {
  border-color: var(--eb-orange);
  transform: translateY(-1px);
}

.eb-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--eb-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.eb-badge-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--eb-soft-blue);
  color: var(--eb-blue);
}

.eb-tone-orange .eb-badge-ico {
  background: var(--eb-soft-orange);
  color: var(--eb-orange);
}

.eb-tone-green .eb-badge-ico {
  background: var(--eb-soft-green);
  color: var(--eb-green);
}

.eb-tone-red .eb-badge-ico {
  background: var(--eb-soft-red);
  color: var(--eb-red);
}

.eb-num {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--body-loud-color);
  font-variant-numeric: tabular-nums;
}

.eb-num.eb-num-text {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.eb-sub {
  color: var(--eb-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.eb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.eb-pill-live {
  background: var(--eb-soft-red);
  color: var(--eb-red);
}

.eb-pill-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: eb-blink 1.4s ease-in-out infinite;
}

.eb-pill-ok {
  background: var(--eb-soft-green);
  color: var(--eb-green);
}

.eb-pill-wait {
  background: var(--eb-soft-orange);
  color: var(--eb-orange);
}

@keyframes eb-blink {
  50% {
    opacity: 0.3;
  }
}

.eb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.eb-span-2 {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
}

.eb-span-2 .eb-chart {
  flex: 1;
  min-height: 170px;
}

.eb-panel {
  padding: 18px;
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  background: var(--eb-surface);
  box-shadow: var(--eb-shadow);
  min-width: 0;
}

.eb-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#content .eb-panel h2 {
  margin: 0;
  color: var(--body-loud-color);
  font-size: 0.9rem;
  font-weight: 700;
}

.eb-panel-head a {
  font-size: 0.78rem;
  font-weight: 600;
}

/* Gráfico de barras */
.eb-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
}

.eb-chart > div {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.eb-chart .bar {
  width: 100%;
  max-width: 36px;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #4b8cf0, var(--eb-blue));
  transition: filter 0.15s;
}

.eb-chart > div:last-child .bar {
  background: linear-gradient(180deg, #ff8a3d, var(--eb-orange));
}

.eb-chart > div:hover .bar {
  filter: brightness(1.15);
}

.eb-chart small {
  color: var(--eb-muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.eb-chart-legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--eb-muted);
  font-size: 0.75rem;
}

.eb-chart-legend strong {
  color: var(--body-loud-color);
  font-size: 0.95rem;
}

/* Listas com barras */
.eb-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.eb-rows li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 6px 0;
  list-style: none;
  font-size: 0.82rem;
}

.eb-rows li strong {
  font-variant-numeric: tabular-nums;
}

.eb-rows .eb-track {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--eb-surface-2);
  overflow: hidden;
}

.eb-rows .eb-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--eb-blue);
}

.eb-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eb-empty {
  color: var(--eb-muted);
  font-size: 0.82rem;
}

/* Actividade recente */
.eb-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.eb-feed li {
  position: relative;
  list-style: none;
  padding: 0 0 12px 18px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.eb-feed li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--eb-blue);
}

.eb-feed li.eb-warning::before {
  background: var(--eb-red);
}

.eb-feed li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 16px;
  bottom: 2px;
  width: 1px;
  background: var(--eb-line);
}

.eb-feed strong {
  color: var(--body-loud-color);
  font-weight: 600;
}

.eb-feed .eb-sub {
  display: block;
  margin-top: 1px;
}

/* Todas as secções */
.eb-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.eb-app {
  padding: 16px 18px;
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  background: var(--eb-surface);
  box-shadow: var(--eb-shadow);
}

.eb-app h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--body-loud-color);
}

.eb-app ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.eb-app li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  padding: 5px 0;
  border-top: 1px solid var(--eb-line);
  font-size: 0.82rem;
}

.eb-app li:first-child {
  border-top: 0;
}

.eb-app li a.eb-add:link,
.eb-app li a.eb-add:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--eb-orange);
  background: var(--eb-soft-orange);
}

.eb-app li a.eb-add .eb-ico {
  width: 14px;
  height: 14px;
}

/* ── Relatório e verificação em dois passos ────────────────────── */
.eb-report {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.eb-report .module {
  margin: 0;
}

.eb-report table {
  width: 100%;
}

.eb-report caption {
  text-align: left;
}

.eb-report td.num {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.eb-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.eb-steps {
  max-width: 640px;
  padding: 24px;
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  background: var(--eb-surface);
  box-shadow: var(--eb-shadow);
}

.eb-steps ol {
  padding-left: 20px;
  line-height: 1.9;
}

.eb-steps code {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--eb-surface-2);
  border: 1px solid var(--eb-line);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.eb-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.eb-inline-form input[type="text"] {
  width: 140px;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-align: center;
}

/* ── Ecrãs pequenos ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .eb-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .eb-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 1024px) {
  #header {
    align-items: flex-start;
    gap: 10px;
  }

  #user-tools {
    gap: 2px 4px;
    line-height: 1.4;
  }

  #user-tools a,
  #user-tools #logout-form button {
    padding: 4px 8px;
  }
}

@media (max-width: 767px) {
  #header {
    padding: 12px 16px;
  }

  #content {
    padding: 20px 16px 40px;
  }

  div.breadcrumbs {
    padding: 10px 16px;
  }

  .object-tools {
    margin-top: 0;
  }

  #content h1.eb-title {
    font-size: 1.5rem;
  }

  .eb-chart {
    gap: 3px;
  }

  .eb-chart small {
    font-size: 0.6rem;
  }
}

/* ── Ícones (traço, 24×24): usados como máscara, por isso herdam a cor do texto ── */
.app-contact, .eb-i-contact { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.app-schedule, .eb-i-schedule { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.app-push, .eb-i-push { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E"); }
.app-newsletter, .eb-i-newsletter { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
.app-gallery, .eb-i-gallery { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E"); }
.app-sitecontent, .eb-i-sitecontent { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E"); }
.app-members, .eb-i-members { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.app-analytics, .eb-i-analytics { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9M13 17V5M8 17v-3'/%3E%3C/svg%3E"); }
.app-core, .eb-i-core { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.eb-i-heart { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E"); }
.eb-i-eye { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.eb-i-phone { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E"); }
.eb-i-live { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14'/%3E%3C/svg%3E"); }
.eb-i-report { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E"); }
.eb-i-send { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
.eb-i-plus { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.eb-i-activity { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 9L9 3l-3 9H2'/%3E%3C/svg%3E"); }
.eb-i-lock { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.eb-i-arrow { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E"); }
.eb-i-folder { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E"); }
.app-reels, .eb-i-reels { --eb-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='2.18'/%3E%3Cpath d='M7 2v20M17 2v20M2 12h20M2 7h5M2 17h5M17 17h5M17 7h5'/%3E%3C/svg%3E"); }
