/* =========================================================================
   Tema de marca SMP para o Django Admin — Projeto Pegada / KW Brasil.
   Reescreve as variáveis de cor do admin (verde/laranja), claro e escuro.
   ========================================================================= */

:root, html[data-theme="light"] {
  --primary: #0a6b3a;
  --secondary: #005730;
  --accent: #e0891f;
  --primary-fg: #ffffff;

  --header-bg: #065a31;
  --header-color: #eaf5ec;
  --header-branding-color: #ffffff;
  --header-link-color: #ffffff;

  --breadcrumbs-bg: #003d21;
  --breadcrumbs-fg: #bcd8c4;
  --breadcrumbs-link-fg: #ffffff;

  --link-fg: #0a6b3a;
  --link-hover-color: #003d21;
  --link-selected-fg: #005730;

  --button-bg: #0a6b3a;
  --button-hover-bg: #005730;
  --button-fg: #ffffff;
  --default-button-bg: #005730;
  --default-button-hover-bg: #003d21;
  --close-button-bg: #6b7a6e;
  --close-button-hover-bg: #55634f;

  --object-tools-bg: #e0891f;
  --object-tools-fg: #ffffff;
  --object-tools-hover-bg: #c2740f;

  --selected-bg: #eef5f0;
  --selected-row: #f6faf7;
  --message-success-bg: #e5f1e8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #2e9e5b;
    --secondary: #0a6b3a;
    --header-bg: #065a31;
    --breadcrumbs-bg: #06301b;
    --link-fg: #56c487;
    --link-hover-color: #86d9a8;
    --link-selected-fg: #56c487;
    --button-bg: #0b6d3b;
    --button-hover-bg: #0a5c32;
    --default-button-bg: #0a6b3a;
    --default-button-hover-bg: #0a5c32;
    --object-tools-bg: #e0891f;
    --object-tools-hover-bg: #c2740f;
    --selected-bg: #123322;
    --selected-row: #10281b;
  }
}
html[data-theme="dark"] {
  --primary: #2e9e5b;
  --secondary: #0a6b3a;
  --header-bg: #065a31;
  --breadcrumbs-bg: #06301b;
  --link-fg: #56c487;
  --link-hover-color: #86d9a8;
  --link-selected-fg: #56c487;
  --button-bg: #0b6d3b;
  --button-hover-bg: #0a5c32;
  --default-button-bg: #0a6b3a;
  --default-button-hover-bg: #0a5c32;
  --object-tools-bg: #e0891f;
  --object-tools-hover-bg: #c2740f;
  --selected-bg: #123322;
  --selected-row: #10281b;
}

/* ---------- Cabeçalho / identidade ---------- */
#header { padding: 10px clamp(16px, 4vw, 40px); align-items: center; }
#branding #site-name { margin: 0; font-weight: 400; }
#branding #site-name a { display: inline-flex; align-items: center; }
#branding #site-name a:hover { opacity: .92; }
/* Lockup real da marca (glifo SMP + texto). O fundo verde do recorte casa com o
   cabeçalho verde; a máscara suave dissolve apenas a borda do retângulo. */
.smp-logo {
  height: 46px; width: auto; display: block; flex: none;
  -webkit-mask: radial-gradient(135% 130% at 42% 50%, #000 86%, transparent 100%);
          mask: radial-gradient(135% 130% at 42% 50%, #000 86%, transparent 100%);
}

/* Link do painel no topo — pílula laranja para destacar no cabeçalho verde */
.smp-painel-link {
  display: inline-flex; align-items: center; margin-left: 18px; padding: 7px 15px;
  border-radius: 999px; background: var(--accent); color: #fff !important;
  font-weight: 700; font-size: .82rem; text-decoration: none; white-space: nowrap;
}
.smp-painel-link:hover { background: #c2740f; }

/* ---------- Refinos estruturais ---------- */
.module { border-radius: 12px; overflow: hidden; border: 1px solid rgba(0,0,0,.05); }
.module caption, .module > h2, .module > table caption {
  letter-spacing: .02em;
}
div.breadcrumbs { padding: 11px clamp(16px, 4vw, 40px); font-size: .82rem; }

.button, input[type=submit], input[type=button], .submit-row input, a.button {
  border-radius: 9px; font-weight: 600; letter-spacing: .01em;
}
.object-tools a { border-radius: 999px; font-weight: 650; }

/* Foco visível acessível */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--accent); outline-offset: 2px;
}

/* ---------- Tela de login branded ---------- */
body.login #container {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--hairline-color, rgba(0,0,0,.08));
  box-shadow: 0 26px 60px -30px rgba(4, 40, 22, .5); max-width: 420px;
}
body.login #header {
  justify-content: center; padding: 30px 24px; text-align: center;
  background: #065a31;
}
body.login .smp-logo { height: 64px; }
body.login #content { padding: 28px 30px 12px; }
body.login .submit-row { padding: 0; margin-top: 6px; }
body.login .submit-row input { width: 100%; padding: 12px; font-size: 1rem; }

.smp-login-intro { text-align: center; color: var(--body-quiet-color, #6b7a6e); font-size: .86rem; margin: 0 0 20px; }

/* Co-branding KW no rodapé do login */
.smp-cobrand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 24px 24px; color: var(--body-quiet-color, #6b7a6e); font-size: .78rem;
}
.smp-cobrand img { height: 26px; width: auto; background: #fff; border-radius: 6px; padding: 4px 7px; border: 1px solid rgba(0,0,0,.08); }
