:root {
  --primary: #102864;
  --secondary: #173b8f;
  --accent: #ffb000;
  --header-color: #ffffff;
  --header-bg: #102864;
  --header-link-color: #ffffff;
  --breadcrumbs-bg: #173b8f;
  --link-fg: #164fc4;
  --link-hover-color: #0d327e;
  --button-bg: #175ccc;
  --button-hover-bg: #10479f;
  --default-button-bg: #175ccc;
  --default-button-hover-bg: #10479f;
  --body-fg: #17213b;
  --body-bg: #f3f6fc;
  --hairline-color: #dce4f2;
  --border-color: #ced8ea;
}

html { font-size: 16px; }
body { color: var(--body-fg); }

#header {
  min-height: 72px;
  padding: 0 28px;
  box-shadow: 0 3px 16px rgba(8, 25, 65, .18);
}

#branding { display: flex; align-items: center; }
.loteca-branding__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff !important;
  text-decoration: none;
}
.loteca-branding__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #102864;
  font-weight: 900;
}
.loteca-branding strong { display: block; font-size: 18px; }
.loteca-branding small { display: block; margin-top: 2px; color: #cedafa; font-size: 12px; }

#user-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
#user-tools a,
#user-tools button {
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  padding: 8px 10px;
}
#user-tools button { color: #fff; }

div.breadcrumbs { padding: 13px 28px; font-size: 14px; }
#content { padding: 28px; }
#content h1 { font-size: 28px; color: #102864; }
#content h2 { font-size: 21px; }

.loteca-dashboard #content { max-width: 1180px; margin: 0 auto; }
.loteca-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0;
}
.loteca-task-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 18px;
  border: 1px solid #d6dfef;
  border-radius: 15px;
  background: #fff;
  color: #17213b !important;
  text-decoration: none !important;
  box-shadow: 0 7px 20px rgba(24, 46, 91, .06);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.loteca-task-card:hover {
  transform: translateY(-2px);
  border-color: #87a8e7;
  box-shadow: 0 12px 26px rgba(24, 62, 137, .12);
}
.loteca-task-card--primary { border-color: #e2b64f; background: #fffaf0; }
.loteca-task-card--settings { border-color: #9cb4df; background: #f8faff; }
.loteca-task-card--iframe {
  grid-column: 1 / -1;
  border: 2px solid #1b9b72;
  background: linear-gradient(135deg, #edfdf7 0%, #fff 100%);
}
.loteca-task-card--iframe .loteca-task-card__number { background: #117c5a; color: #fff; font-size: 12px; }
.loteca-task-card--visual {
  grid-column: 1 / -1;
  border: 2px solid #ffb000;
  background: linear-gradient(135deg, #fff9e8 0%, #fff 100%);
}
.loteca-task-card--visual .loteca-task-card__number { background: #ffb000; color: #102864; }
.loteca-task-card__number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e9f0ff;
  color: #164fc4;
  font-size: 17px;
  font-weight: 800;
}
.loteca-task-card--primary .loteca-task-card__number { background: #ffb000; color: #102864; }
.loteca-task-card strong { display: block; margin-bottom: 6px; color: #102864; font-size: 17px; }
.loteca-task-card small { color: #65728b; font-size: 13px; line-height: 1.45; }
.loteca-task-card__arrow { color: #175ccc; font-size: 24px; }

.loteca-iframe-panel {
  margin: 26px 0;
  padding: 26px;
  border: 2px solid #b9d8cc;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 26px rgba(18, 91, 68, .09);
  scroll-margin-top: 24px;
}
.loteca-iframe-panel:target { border-color: #117c5a; box-shadow: 0 0 0 4px rgba(17, 124, 90, .10), 0 9px 26px rgba(18, 91, 68, .12); }
.loteca-iframe-panel__heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 22px; }
.loteca-iframe-panel__heading h2 { margin: 4px 0 7px; color: #102864; }
.loteca-iframe-panel__heading p { margin: 0; color: #63708a; line-height: 1.55; }
.loteca-iframe-panel__icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border-radius: 13px;
  background: #117c5a;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.loteca-iframe-panel__eyebrow { color: #117c5a; font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.loteca-iframe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.loteca-iframe-card { padding: 20px; border: 1px solid #d6dfef; border-radius: 13px; background: #f8faff; }
.loteca-iframe-card__title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.loteca-iframe-card__title h3 { margin: 0 0 4px; color: #102864; font-size: 18px; }
.loteca-iframe-card__title p { margin: 0; color: #63708a; font-size: 13px; line-height: 1.45; }
.loteca-iframe-card__badge {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7efff;
  color: #164fc4;
  font-weight: 900;
}
.loteca-iframe-card label { display: block; margin-bottom: 7px; color: #24385e; font-size: 13px; font-weight: 800; }
.loteca-iframe-card textarea {
  display: block;
  width: 100%;
  min-height: 126px;
  box-sizing: border-box;
  resize: vertical;
  padding: 12px;
  border: 1px solid #b9c8e1;
  background: #fff;
  color: #263552;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.loteca-iframe-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.loteca-iframe-card__actions .button { min-height: 40px; box-sizing: border-box; padding: 10px 14px; cursor: pointer; }
.loteca-copy-iframe--copied { background: #117c5a !important; }
.loteca-iframe-test { background: #e8eef9 !important; color: #173b8f !important; }
.loteca-iframe-panel__notice { margin: 18px 0 0; padding: 12px 14px; border-radius: 9px; background: #fff6d9; line-height: 1.5; }

.loteca-help-panel {
  padding: 24px 28px;
  border-left: 5px solid #175ccc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(24, 46, 91, .06);
}
.loteca-help-panel h2 { margin-top: 0; color: #102864; }
.loteca-help-panel ol { padding-left: 22px; }
.loteca-help-panel li { margin: 11px 0; line-height: 1.55; }
.loteca-help-panel p { margin-bottom: 0; padding: 12px; border-radius: 8px; background: #fff5d9; }

.loteca-advanced { margin-top: 22px; padding: 18px 22px; border: 1px solid #d4ddea; border-radius: 12px; background: #fff; }
.loteca-advanced summary { cursor: pointer; color: #28436f; font-size: 15px; font-weight: 700; }
.loteca-advanced__warning { margin: 18px 0; color: #7a4b00; }

.loteca-settings { max-width: 1040px; margin: 0 auto; }
.loteca-settings__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.loteca-settings__intro h1 { margin: 4px 0 8px; }
.loteca-settings__intro p { max-width: 720px; margin: 0; color: #63708a; line-height: 1.55; }
.loteca-settings__eyebrow { color: #175ccc; font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.loteca-settings__view-link { flex: 0 0 auto; padding: 11px 15px !important; }
.loteca-settings-card {
  margin-bottom: 22px;
  padding: 26px;
  border: 1px solid #d6dfef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 46, 91, .07);
}
.loteca-settings-card__heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.loteca-settings-card__heading h2 { margin: 0 0 6px; color: #102864; }
.loteca-settings-card__heading p { margin: 0; color: #63708a; line-height: 1.5; }
.loteca-settings-card__icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  background: #e9f0ff;
  color: #164fc4;
  font-size: 17px;
  font-weight: 900;
}
.loteca-switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid #cddaf0;
  border-radius: 11px;
  background: #f7faff;
}
.loteca-switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: #175ccc; }
.loteca-switch-row label { cursor: pointer; }
.loteca-switch-row strong { display: block; color: #102864; font-size: 15px; }
.loteca-switch-row small { display: block; margin-top: 4px; color: #63708a; line-height: 1.45; }
.loteca-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.loteca-field--wide, .loteca-field--full { grid-column: 1 / -1; }
.loteca-field label { display: block; margin-bottom: 7px; color: #24385e; font-size: 14px; font-weight: 800; }
.loteca-field input:not([type=checkbox]), .loteca-field select, .loteca-field textarea { width: 100%; box-sizing: border-box; }
.loteca-field textarea { padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; line-height: 1.55; }
.loteca-field .errorlist, .loteca-switch-row .errorlist { margin: 8px 0 0; color: #a61b1b; font-weight: 700; }
.loteca-settings-warning { margin-bottom: 20px; padding: 14px 16px; border-left: 4px solid #ffb000; border-radius: 8px; background: #fff8e5; line-height: 1.5; }
.loteca-preview { margin-top: 22px; border: 1px solid #d7e0ee; border-radius: 11px; overflow: hidden; }
.loteca-preview summary { cursor: pointer; padding: 14px 16px; color: #28436f; background: #f7f9fd; font-weight: 800; }
.loteca-preview__actions { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.loteca-preview__actions span { color: #63708a; font-size: 13px; }
.loteca-preview iframe { display: block; width: 100%; height: 300px; border: 0; border-top: 1px solid #d7e0ee; background: #f3f5f8; }
.loteca-installed-codes { margin-top: 22px; border: 1px solid #b9d8c6; border-radius: 11px; overflow: hidden; background: #f6fcf8; }
.loteca-installed-codes > summary { cursor: pointer; padding: 14px 16px; color: #155d36; background: #e8f7ed; font-weight: 800; }
.loteca-installed-codes > p { margin: 16px; color: #355446; line-height: 1.55; }
.loteca-installed-code { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin: 16px; padding: 16px; border: 1px solid #d5e7dc; border-radius: 10px; background: #fff; }
.loteca-installed-code h3 { margin: 0 0 5px; color: #102864; font-size: 15px; }
.loteca-installed-code p { margin: 0; color: #63708a; line-height: 1.45; }
.loteca-installed-code pre { grid-column: 1 / -1; max-height: 180px; overflow: auto; margin: 0; padding: 12px; border-radius: 8px; background: #142445; color: #e7f0ff; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.loteca-copy-code { align-self: start; white-space: nowrap; }
.loteca-settings__submit { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.loteca-settings__submit p { margin: 0; color: #63708a; line-height: 1.45; }

.module,
.inline-group { border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(24, 46, 91, .06); }
.module h2,
.inline-group h2 { padding: 13px 15px; font-size: 15px; }
.aligned label { font-size: 14px; font-weight: 700; color: #24385e; }
.help, p.help, form p.help, div.help, form div.help, div.help li { color: #63708a; font-size: 13px; line-height: 1.5; }
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], textarea, select {
  min-height: 40px;
  border-radius: 8px;
  font-size: 15px;
}
.submit-row { border-radius: 12px; padding: 14px; position: sticky; bottom: 0; z-index: 10; box-shadow: 0 -5px 20px rgba(25, 45, 85, .10); }
.submit-row input { min-height: 42px; padding: 10px 18px; font-size: 14px; }

.loteca-caixa-link { background-color: #16803b !important; }
.loteca-caixa-import { max-width: 880px; margin: 0 auto; }
.loteca-caixa-import__heading { margin-bottom: 24px; }
.loteca-caixa-import__heading h1 { margin: 6px 0 10px; }
.loteca-caixa-import__heading p { max-width: 720px; color: #63708a; line-height: 1.55; }
.loteca-caixa-contests { display: grid; gap: 14px; margin-bottom: 22px; }
.loteca-caixa-contest {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 2px solid #d6dfef;
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(24, 46, 91, .05);
}
.loteca-caixa-contest:has(input:checked) { border-color: #175ccc; background: #f5f8ff; }
.loteca-caixa-contest input { width: 22px; height: 22px; accent-color: #175ccc; }
.loteca-caixa-contest strong { display: block; color: #102864; font-size: 18px; }
.loteca-caixa-contest small { display: block; margin-top: 5px; color: #63708a; font-size: 14px; }
.loteca-caixa-contest em { padding: 6px 9px; border-radius: 999px; background: #e4f7e9; color: #16642f; font-size: 12px; font-style: normal; font-weight: 800; }
.loteca-caixa-active { background: #fff; }
.loteca-caixa-notice { margin: 22px 0; padding: 16px 18px; border-left: 4px solid #ffb000; border-radius: 9px; background: #fff8e5; }
.loteca-caixa-notice p { margin: 5px 0 0; line-height: 1.5; }
.loteca-caixa-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.loteca-caixa-actions button { min-height: 42px; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; }

/* Mantém data e jogos legíveis mesmo em notebooks menores. */
.inline-group .tabular { overflow-x: auto; }
.inline-group .tabular table { min-width: 960px; }
.inline-group .tabular td.field-match_time,
.inline-group .tabular th.column-match_time { min-width: 140px; }
.inline-group .tabular td.field-match_time input { width: 135px; min-width: 135px; }
.inline-group .tabular td.field-home_show,
.inline-group .tabular td.field-away_show { min-width: 190px; }
.inline-group .tabular td.field-home_show input,
.inline-group .tabular td.field-away_show input { width: 100%; min-width: 180px; }

@media (max-width: 900px) {
  #header { align-items: flex-start; height: auto; padding: 16px; }
  #user-tools { margin-top: 12px; }
  #content { padding: 18px 14px; }
  .loteca-quick-grid { grid-template-columns: 1fr; }
  .loteca-iframe-grid { grid-template-columns: 1fr; }
  .loteca-settings__intro { align-items: flex-start; flex-direction: column; }
  .loteca-caixa-contest { grid-template-columns: auto 1fr; }
  .loteca-caixa-contest em { grid-column: 2; justify-self: start; }
}

@media (max-width: 560px) {
  .loteca-branding small, #user-tools > span { display: none; }
  .loteca-branding strong { font-size: 16px; }
  .loteca-task-card { grid-template-columns: auto 1fr; }
  .loteca-task-card__arrow { display: none; }
  #content h1 { font-size: 24px; }
  .loteca-settings-card { padding: 18px; }
  .loteca-installed-code { grid-template-columns: 1fr; }
  .loteca-copy-code { justify-self: start; }
  .loteca-fields-grid { grid-template-columns: 1fr; }
  .loteca-field--wide, .loteca-field--full { grid-column: auto; }
  .loteca-settings__submit { align-items: stretch; flex-direction: column; }
  .loteca-iframe-panel { padding: 18px; }
  .loteca-iframe-panel__heading { flex-direction: column; }
  .loteca-iframe-card__actions { align-items: stretch; flex-direction: column; }
  .loteca-iframe-card__actions .button { width: 100%; text-align: center; }
}
