/*
 * Tema visual do painel Postal (overlay local, nao faz parte do projeto oficial).
 * Carregado DEPOIS do CSS original pelos layouts; so sobrescreve cor, tipografia,
 * raio, sombra e espacamento. Nao muda estrutura nem posicionamento.
 * Para desligar: remover a linha %link dos layouts (ou apagar este arquivo).
 */

:root {
  --p-primary: #4f46e5;
  --p-primary-dark: #4338ca;
  --p-primary-soft: #eef2ff;
  --p-ink: #0f172a;
  --p-ink-2: #1e293b;
  --p-text: #1f2937;
  --p-muted: #64748b;
  --p-faint: #94a3b8;
  --p-line: #e5e7eb;
  --p-line-soft: #eef0f4;
  --p-bg: #f5f6fa;
  --p-card: #ffffff;
  --p-green: #16a34a;
  --p-red: #dc2626;
  --p-orange: #ea580c;
  --p-cyan: #0891b2;
  --p-purple: #7c3aed;
  --p-radius: 12px;
  --p-radius-sm: 8px;
  --p-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px rgba(15, 23, 42, 0.06);
  --p-ring: 0 0 0 3px rgba(79, 70, 229, 0.22);
  --p-font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --p-mono: "Cascadia Code", "JetBrains Mono", "Droid Sans Mono", Consolas, monospace;
}

/* ---------- base ---------- */
html.main,
html.subPage {
  font-family: var(--p-font);
  background: var(--p-bg);
  color: var(--p-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
select, input, textarea, button { font-family: inherit; }
::selection { background: rgba(79, 70, 229, 0.18); }
.turbolinks-progress-bar { background-color: var(--p-primary); height: 3px; }
.u-green { color: var(--p-green); }
.u-orange { color: var(--p-orange); }
.u-red { color: var(--p-red); }
.u-grey { color: var(--p-faint); }
.u-link { text-decoration-color: rgba(79, 70, 229, 0.45); text-underline-offset: 2px; }
.u-link:hover { color: var(--p-primary); }

/* ---------- barra superior ---------- */
.siteHeader {
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 2px 10px rgba(15, 23, 42, 0.18);
}
.siteHeader__inside { padding: 14px 22px; }
.siteHeader__logo a { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.siteHeader__version { margin-left: 10px; opacity: 0.45; font-size: 12px; }
.siteHeader__nav { font-size: 13px; }
.siteHeader__navItem { margin-left: 22px; opacity: 0.92; }
.siteHeader__navItem:hover { opacity: 1; }
.siteHeader__subMenu {
  border-radius: var(--p-radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--p-line);
  margin-top: 4px;
  min-width: 210px;
  color: var(--p-text);
}
.siteHeader__subMenuItem + .siteHeader__subMenuItem { border-top-color: var(--p-line-soft); }
.siteHeader__subMenuItem--header { background: var(--p-primary-soft); color: var(--p-primary); padding: 9px 16px; font-size: 12px; }
.siteHeader__subMenuLink { padding: 11px 16px; transition: background-color 0.12s ease; }
.siteHeader__subMenuLink:hover { background-color: #f8fafc; color: var(--p-primary); }
.siteHeader__remember { background: var(--p-ink); border-radius: var(--p-radius); box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35); }
.siteHeader__rememberText { color: var(--p-faint); }

/* ---------- titulo da pagina + abas ---------- */
.pageHeader { background: var(--p-card); padding: 24px 35px 18px; border-bottom: 1px solid var(--p-line); }
.pageHeader__title { color: var(--p-ink); font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.pageHeader__titlePrevious { opacity: 0.35; font-weight: 400; }

.navBar,
.navBar--secondary,
.navBar--tertiary {
  background: var(--p-card);
  color: var(--p-muted);
  padding: 0 35px;
  border: 0;
  border-bottom: 1px solid var(--p-line);
}
.navBar--secondary { background: #fafbfd; }
.navBar ul { flex-wrap: wrap; }
.navBar__item:not(:last-child) { margin-right: 28px; }
.navBar__link,
.navBar--tertiary .navBar__link {
  display: inline-block;
  padding: 14px 0 12px;
  color: var(--p-muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.navBar__link:hover { color: var(--p-ink); text-decoration: none; border-bottom-color: #cbd5e1; }
.navBar__link.is-active,
.navBar--secondary .navBar__link.is-active,
.navBar--tertiary .navBar__link.is-active {
  color: var(--p-primary);
  font-weight: 600;
  border-bottom-color: var(--p-primary);
}
.navBar__itemCounter {
  background: var(--p-red);
  color: #fff;
  border-radius: 999px;
  padding: 3px 6px 2px;
  font-weight: 600;
}
.navBar__itemCounter.is-empty { background-color: #e2e8f0; color: var(--p-muted); }

/* ---------- cabecalho do servidor ---------- */
.serverHeader { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); padding: 26px 35px; overflow: hidden; }
.serverHeader__title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.serverHeader__list { font-size: 13px; line-height: 1.6; }
.serverHeader__list--ok { color: #4ade80; }
.serverHeader__list--warning { color: #fb923c; }
.serverHeader__stats,
.serverHeader__usage {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--p-radius);
  padding: 16px 18px;
}
.serverHeader__statsList { font-size: 13px; }
.serverHeader__statsList li { font-weight: 400; }
.serverHeader__usageTitle { color: var(--p-faint); text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.serverHeader__usageLineValueLarge { color: var(--p-faint); }
.serverHeader__stripe--live { background-color: var(--p-green); }
.serverHeader__stripe--suspended { background-color: var(--p-red); }
.bar { background: #334155; }
.serverHeader .bar { background: rgba(255, 255, 255, 0.14); }
.bar__inner { background: linear-gradient(90deg, #6366f1, #818cf8); }

/* ---------- barra lateral ---------- */
.sidebar { box-shadow: none; border-right: 1px solid var(--p-line); }
.sidebar__search { background: #fafbfd; border-bottom-color: var(--p-line); padding: 14px; }
.sidebar__searchInput { border: 1px solid #d8dde6; border-radius: 10px; padding-top: 8px; padding-bottom: 8px; font-weight: 500; color: var(--p-ink); background-position: 10px 9px; }
.sidebar__searchInput::placeholder { color: var(--p-faint); font-weight: 400; }
.sidebar__searchInput:focus { border-color: var(--p-primary); box-shadow: var(--p-ring); outline: 0; }
.sidebar__placeholder { color: var(--p-faint); font-size: 15px; font-weight: 400; }
.sidebar__new a:hover { color: var(--p-primary); }
.sidebarServerList { color: var(--p-text); }
.sidebarServerList__item { border-bottom-color: var(--p-line-soft); }
.sidebarServerList__link { padding: 14px 18px; transition: background-color 0.12s ease; }
.sidebarServerList__link:hover { background-color: #f8fafc; }
.sidebarServerList__link.is-active { background-color: var(--p-primary-soft); box-shadow: inset 3px 0 0 var(--p-primary); }
.sidebarServerList__title { font-size: 14px; color: var(--p-ink); }
.sidebarServerList__quantity { color: var(--p-faint); }

/* ---------- conteudo ---------- */
.pageContent__intro { color: var(--p-muted); font-size: 17px; line-height: 1.6; font-weight: 400; }
.pageContent__title { color: var(--p-ink); letter-spacing: -0.01em; }
.pageContent__subTitle { color: var(--p-ink); border-bottom-color: var(--p-line); padding-bottom: 8px; margin-bottom: 14px; }
.pageContent__text { line-height: 1.6; }
.pageContent__pageEntriesInfo,
.pageContent__definitionText,
.pageContent__definitions dt { color: var(--p-muted); }
.pageContent__definitionCode { font-family: var(--p-mono); font-size: 14px; }
.pageContent__helpLink a { color: var(--p-primary); }
.titleWithLinks { color: var(--p-ink); }
.titleWithLinks__title { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.titleWithLinks__link { color: var(--p-muted); text-decoration: none; font-weight: 500; }
.titleWithLinks__link:hover { color: var(--p-primary); text-decoration: underline; }
.siteContent__footer { border-top-color: var(--p-line); }
.footer__links { color: var(--p-faint); }

/* ---------- cartoes / listas ---------- */
.largeList,
.messageList,
.domainList,
.credentialList,
.endpointList,
.routeList,
.webhookList,
.userList,
.ipList,
.limits,
.checkboxList {
  background: var(--p-card);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  color: var(--p-text);
}
.largeList__item:nth-child(even),
.messageList__message:nth-child(even) .messageList__link,
.domainList__item:nth-child(even),
.credentialList__item:nth-child(even),
.endpointList__item:nth-child(even),
.routeList__item:nth-child(even),
.webhookList__item:nth-child(even),
.userList__item:nth-child(even),
.ipList__item:nth-child(even) {
  background: #fbfcfe;
}
.largeList__item + .largeList__item,
.domainList__item + .domainList__item,
.credentialList__item + .credentialList__item,
.endpointList__item + .endpointList__item,
.routeList__item + .routeList__item,
.webhookList__item + .webhookList__item,
.userList__item + .userList__item,
.ipList__item + .ipList__item,
.messageList__message + .messageList__message {
  border-top-color: var(--p-line-soft);
}
.largeList__link { padding: 16px 18px; transition: background-color 0.12s ease; }
.largeList__link:hover,
.largeList__link:active { background: var(--p-primary-soft); color: var(--p-ink); }
.largeList__item.is-highlighted { background: var(--p-primary-soft); color: var(--p-ink); box-shadow: inset 3px 0 0 var(--p-primary); }
.largeList__subText { color: var(--p-muted); }
.messageList__link:hover,
.credentialList__link:hover,
.endpointList__link:hover,
.routeList__link:hover { background: var(--p-primary-soft) !important; }
.domainList__verificationLink { background: var(--p-primary); border-radius: var(--p-radius-sm); }
.domainList__ssl { color: var(--p-green); }
.limits__value { color: var(--p-ink); letter-spacing: -0.02em; }

.noData {
  background: var(--p-card);
  border: 1px dashed #cbd5e1;
  border-radius: var(--p-radius);
  box-shadow: none;
  padding: 44px 30px 36px;
}
.noData--clean { background-color: transparent; border-color: transparent; }
.noData__title { color: var(--p-ink); font-size: 20px; letter-spacing: -0.01em; }
.noData__text { color: var(--p-muted); font-size: 15px; line-height: 1.6; }
.noData__postButtonText { color: var(--p-faint); }

/* ---------- tabelas ---------- */
.dataTable { border: 1px solid var(--p-line); box-shadow: var(--p-shadow); font-size: 13px; }
.dataTable tr td { border-left-color: var(--p-line-soft); padding: 10px 12px; }
.dataTable tr th,
.dataTable thead td { background: #f8fafc; color: var(--p-muted); padding: 10px 12px; }
.dataTable thead td { border-bottom: 1px solid var(--p-line); text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
.dataTable tbody tr:nth-child(even) td { background: #fbfcfe; }
.dataTable tbody tr:hover td { background: var(--p-primary-soft); }
.dataTable__inputCell input { color: var(--p-primary); }

/* ---------- botoes ---------- */
.button {
  background: var(--p-primary);
  border: 0;
  border-radius: var(--p-radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
  transition: filter 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
.button:hover { filter: brightness(1.07); }
.button:active { background-color: var(--p-primary-dark); transform: translateY(1px); filter: none; }
.button:focus { background-color: var(--p-primary); box-shadow: var(--p-ring); outline: 0; }
.button--small { padding: 5px 11px; border-width: 0; }
.button--positive,
.button--positive:focus { background-color: var(--p-green); }
.button--positive:active { background-color: #15803d; }
.button--positive:focus { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25); }
.button--neutral,
.button--neutral:focus { background-color: #e8ebf0; color: var(--p-ink-2); box-shadow: none; }
.button--neutral:active { background-color: #d8dde6; }
.button--neutral:focus { box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.25); }
.button--danger,
.button--danger:focus { background-color: var(--p-red); }
.button--danger:active { background-color: #b91c1c; }
.button--danger:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25); }
.button--dark,
.button--dark:focus { background-color: var(--p-ink-2); }
.button--dark:active { background-color: var(--p-ink); }
/* os GIFs de carregamento foram feitos para as cores originais */
.button.is-spinning { background-color: #0e69d5; filter: none; }
.button--positive.is-spinning { background-color: #76c83b; }
.button--neutral.is-spinning { background-color: #cccccc; }
.button--danger.is-spinning { background-color: #e2383a; }
.button--dark.is-spinning { background-color: #3c4249; }

/* ---------- campos ---------- */
.input {
  border: 1px solid #d5dae3;
  border-radius: var(--p-radius-sm);
  padding: 10px 12px;
  color: var(--p-ink);
  font-weight: 500;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input--onWhite { background-color: #f9fafb; }
.input:hover { border-color: #b8c0cc; }
.input:focus { border-color: var(--p-primary); box-shadow: var(--p-ring); outline: 0; background-color: #fff; }
.input::placeholder { color: var(--p-faint); font-weight: 400; }
.input--danger { color: var(--p-red); border-color: #fca5a5; border-width: 1px; }
.input--danger:focus { border-color: var(--p-red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }
.input--code { font-family: var(--p-mono); }
.fieldSet__label { text-transform: none; font-size: 13px; color: #374151; letter-spacing: 0; }
.fieldSet__text,
.fieldSet__titleSubText { color: var(--p-muted); line-height: 1.55; }
.fieldSet__title { color: var(--p-ink); border-bottom: 1px solid var(--p-line); padding-bottom: 8px; letter-spacing: -0.01em; }
.checkboxList__item + .checkboxList__item { border-top-color: var(--p-line-soft); }
.multibox__input { border-radius: var(--p-radius); }
.messageSearch__input { border: 1px solid #d5dae3; border-radius: 12px; padding-top: 9px; padding-bottom: 9px; font-weight: 500; color: var(--p-ink); background-position: 12px 10px; }
.messageSearch__input::placeholder { color: var(--p-faint); font-weight: 400; }
.messageSearch__input:focus { border-color: var(--p-primary); box-shadow: var(--p-ring); outline: 0; }
.messageSearch__help { top: 13px; color: var(--p-muted); }
.messageSearch__helpBox { background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--p-radius); box-shadow: var(--p-shadow); color: var(--p-text); }

/* ---------- etiquetas ---------- */
.label { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; padding: 3px 8px; line-height: 1.15; background: var(--p-ink-2); }
.label--large { font-size: 11px; padding: 5px 11px; }
.label--green, .label--serverStatus-live, .label--messageStatus-sent, .label--messageStatus-processed, .label--http-status-2 { background-color: var(--p-green); }
.label--red, .label--serverStatus-suspended, .label--messageStatus-hard_fail, .label--messageStatus-bounced, .label--http-status-4, .label--http-status-5 { background-color: var(--p-red); }
.label--orange, .label--messageStatus-soft_fail, .label--credentialType-smtp_ip, .label--http-status-3 { background-color: var(--p-orange); }
.label--blue, .label--turquoise, .label--credentialType-api { background-color: var(--p-primary); }
.label--purple { background-color: var(--p-purple); }
.label--grey, .label--serverStatus-development, .label--messageStatus-held { background-color: #64748b; }
.label--messageStatus-pending { background-color: var(--p-faint); }
.label--messageStatus-hold_cancelled { background-color: #cbd5e1; }
.label--credentialType-smtp { background-color: var(--p-cyan); }
.label--spamStatus-not_checked { background: var(--p-faint); }
.label--spamStatus-spam { background: var(--p-orange); }
.label--spamStatus-not_spam { background: var(--p-cyan); }

/* ---------- avisos ---------- */
html.main .flashMessage {
  background: var(--p-red);
  border-radius: var(--p-radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  padding: 14px 16px;
  width: 340px;
}
html.main .flashMessage--notice { background: var(--p-green); }
html.subPage .flashMessage { background: var(--p-red); }
html.subPage .flashMessage--notice { background: var(--p-green); }
.warningBox { background-color: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--p-radius-sm); color: #78350f; }
.dangerZone { border: 1px dashed #fca5a5; border-radius: var(--p-radius); background: #fef2f2; color: #b91c1c; }
.errorExplanation { border-radius: var(--p-radius); box-shadow: 0 0 0 1px #fecaca, var(--p-shadow); }
.codeBlock { background: var(--p-ink); color: #e2e8f0; border-radius: var(--p-radius); font-family: var(--p-mono); font-size: 13px; line-height: 1.6; padding: 20px 22px; }
.simplePagination__link { color: var(--p-primary); border-color: var(--p-line); border-radius: var(--p-radius-sm); padding: 6px 12px; font-weight: 500; }
.simplePagination__link:hover { border-color: var(--p-primary); background: var(--p-primary-soft); }
.simplePagination__current { color: var(--p-muted); }

/* ---------- telas de entrada (login / redefinir senha) ---------- */
html.subPage {
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(700px 380px at 100% 100%, rgba(14, 165, 233, 0.10), transparent 70%),
    var(--p-bg);
  background-attachment: fixed;
}
html.subPage body { padding-top: 14vh; padding-bottom: 60px; }
.subPageBox {
  width: 380px;
  max-width: calc(100% - 32px);
  border-top: 0;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 24px 60px rgba(15, 23, 42, 0.14);
}
.subPageBox--wide { width: 540px; }
.subPageBox__title {
  background: transparent;
  border-bottom: 0;
  color: var(--p-ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 30px 30px 4px;
}
.subPageBox__content { padding: 20px 30px 30px; }
.subPageBox__text { color: var(--p-muted); font-size: 14px; line-height: 1.55; }
.loginForm__input { margin-bottom: 14px; }
.loginForm__submit { margin-top: 20px; }
.loginForm__submit .button,
.loginForm__submit .button:focus { background-color: var(--p-primary); padding: 10px 24px; }
.loginForm__submit .button:active { background-color: var(--p-primary-dark); }
.loginForm__submit .button:focus { box-shadow: var(--p-ring); }
.loginForm__submit .button.is-spinning { background-color: #76c83b; }
.loginForm__links { color: var(--p-muted); }
.loginForm__links a:hover { color: var(--p-primary); }
.loginForm__divider { border-top-color: var(--p-line); }
.loginForm__localTitle { color: var(--p-faint); }

/* ---------- barras de rolagem ---------- */
.sidebar::-webkit-scrollbar-thumb,
.siteContent__main::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.siteContent__main::-webkit-scrollbar { width: 10px; }
.siteContent__main::-webkit-scrollbar-track { background: transparent; }
