/* Planeta do Bebê: identidade visual local, sem dependências externas. */
@font-face {
  font-family: 'Fredoka';
  src: url('/static/fonts/Fredoka.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --turquoise: #2AB1B7;
  --magenta: #C55FA0;
  --blue: #A2DAF8;
  --yellow: #F9CB08;
  --coral: #ED6F66;
  --ink: #494949;
  --muted: #66717C;
  --line: #E1E8EE;
  --bg: #F6F9FC;
  --teal-ink: #17666C;
  --turquoise-soft: #EAF8F8;
  --blue-soft: #EFF8FE;
  --magenta-soft: #FAEEF6;
  --yellow-soft: #FFF9DF;
  --coral-soft: #FFF1EF;
  --red: #A83430;
  --body-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --heading-font: 'Fredoka', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--body-font); }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 600; transition: background .15s ease, box-shadow .15s ease; }
button:disabled { opacity: .45; cursor: default; }
input, select { border: 1px solid #C9D6E0; background: #fff; color: var(--ink); border-radius: 9px; padding: 10px 12px; width: 100%; min-width: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: 3px; }
input[type='checkbox'] { accent-color: var(--teal-ink); }
label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--heading-font); font-weight: 500; }
h1 { font-size: 34px; letter-spacing: -.5px; line-height: 1.2; margin-bottom: 0; }
h2 { font-size: 20px; line-height: 1.3; margin-bottom: 5px; }
h3 { font-size: 20px; }
small, .muted { color: var(--muted); }
small { font-size: 12px; }
a { color: var(--teal-ink); }
[hidden] { display: none !important; }
.primary { background: var(--turquoise); color: #18383D; }
.primary:hover:not(:disabled) { background: #50C1C6; box-shadow: 0 3px 12px #2AB1B724; }
.secondary { background: #fff; border: 1px solid #D6E1E9; color: var(--ink); }
.secondary:hover:not(:disabled) { background: var(--blue-soft); border-color: #94B6C9; }
.text-button { background: transparent; color: var(--teal-ink); padding: 8px 0; text-align: left; }
.text-button:hover { text-decoration: underline; }
.eyebrow { font-size: 10px; letter-spacing: 1.7px; font-weight: 700; margin-bottom: 9px; color: var(--muted); }
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
aside { background: #fff; color: var(--ink); border-right: 1px solid var(--line); padding: 16px 18px 25px; position: fixed; inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; overflow-y: auto; }
aside::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(to right, var(--turquoise) 0% 35%, var(--blue) 35% 55%, var(--magenta) 55% 72%, var(--yellow) 72% 86%, var(--coral) 86%); }
.wordmark { display: block; text-decoration: none; align-self: center; }
.wordmark img { display: block; width: 184px; height: 184px; object-fit: contain; }
.sidebar-product { text-align: center; padding: 0 0 13px; }
.sidebar-product strong { font-family: var(--heading-font); font-size: 23px; font-weight: 500; }
.brand-sub { display: block; font-size: 9px; letter-spacing: 1.8px; margin-top: 2px; color: var(--muted); }
.local-badge { font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-align: center; align-self: center; padding: 4px 10px; background: var(--blue-soft); color: #496777; border-radius: 6px; margin: 0 0 26px; }
nav { display: grid; gap: 7px; }
nav button { display: flex; align-items: center; gap: 11px; background: transparent; border: 1px solid transparent; color: #65727D; text-align: left; padding: 12px 10px; }
nav button svg { width: 19px; height: 19px; flex: 0 0 19px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
nav button span { font-size: 12px; }
nav button:hover { background: var(--blue-soft); color: var(--teal-ink); }
nav button.selected { background: var(--turquoise-soft); color: var(--teal-ink); border-color: #D5EDEF; }
.sidebar-footer { margin-top: auto; padding: 28px 10px 0; display: grid; font-size: 11px; color: var(--muted); }
#who { overflow-wrap: anywhere; }
main { grid-column: 2; padding: 33px 34px 26px; min-width: 0; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; gap: 20px; }
main > header .eyebrow { color: var(--teal-ink); }
.header-actions { display: flex; gap: 18px; align-items: center; }
.mode-switch { flex-direction: row; align-items: center; font-size: 11px; color: var(--muted); }
.mode-switch select { width: 144px; font-size: 12px; padding: 8px; }
.status-chip { border: 1px solid var(--line); background: white; border-radius: 20px; padding: 8px 12px; font-size: 11px; white-space: nowrap; color: var(--muted); }
.status-chip i { display: inline-block; width: 6px; height: 6px; background: var(--turquoise); border-radius: 50%; margin-right: 5px; }
.banner { background: var(--yellow-soft); color: #6D5810; border: 1px solid #ECDD9E; padding: 10px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 12px; }
.filters { display: grid; grid-template-columns: 1fr 1fr 1.45fr 1.5fr auto; align-items: end; gap: 12px; margin-bottom: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric-grid article { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); padding: 19px 19px 17px; border-radius: 13px; display: flex; flex-direction: column; min-width: 0; }
.metric-grid article:first-child { background: var(--turquoise-soft); border-color: #C9E8E9; border-top-color: var(--turquoise); }
.metric-grid article:nth-child(2) { border-top-color: var(--magenta); }
.metric-grid article:nth-child(3) { border-top-color: var(--yellow); }
.metric-grid article:nth-child(4) { border-top-color: var(--coral); }
.metric-grid article:first-child strong { color: var(--teal-ink); }
.metric-grid article > span { font-size: 12px; }
.metric-grid strong { font-size: 29px; letter-spacing: -1px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; margin: 14px 0 10px; overflow-wrap: anywhere; }
.metric-grid small { font-size: 10px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.inset { padding: 25px; margin-top: 20px; }
.inset p { color: var(--muted); max-width: 850px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 23px 15px; }
.panel-title p { font-size: 11px; color: var(--muted); margin: 0; }
.tag { font-size: 10px; background: var(--blue-soft); padding: 4px 10px; border-radius: 6px; color: #456373; }
.chart-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; margin-bottom: 22px; }
.daily-chart { height: 236px; padding: 5px 16px 12px; }
.daily-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-gridline { stroke: var(--line); }
.chart-tick { fill: var(--muted); font-size: 10px; }
.chart-area { fill: var(--turquoise); fill-opacity: .10; }
.chart-line { fill: none; stroke: var(--turquoise); stroke-width: 2.5; }
.chart-point { fill: #fff; stroke: var(--teal-ink); stroke-width: 1.5; }
.empty { padding: 45px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
#account-chart { padding: 5px 23px 22px; max-height: 236px; overflow: auto; }
.bar-row { margin: 12px 0 16px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; margin-bottom: 7px; }
.bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; background: #F0F4F8; border-radius: 8px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--turquoise); border-radius: 8px; }
.bar-row:nth-child(5n + 2) .bar-track i { background: var(--magenta); }
.bar-row:nth-child(5n + 3) .bar-track i { background: var(--blue); }
.bar-row:nth-child(5n + 4) .bar-track i { background: var(--yellow); }
.bar-row:nth-child(5n + 5) .bar-track i { background: var(--coral); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
th { font-weight: 600; font-size: 10px; letter-spacing: .4px; color: var(--muted); padding: 12px 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #F5F9FD; white-space: nowrap; }
td { padding: 13px 23px; border-bottom: 1px solid #EDF1F5; vertical-align: middle; }
tbody tr:hover { background: #FAFCFE; }
td small { display: block; font-size: 10px; }
td strong { font-weight: 600; }
.right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; background: var(--turquoise-soft); color: var(--teal-ink); border-radius: 6px; padding: 4px 8px; font-size: 10px; white-space: nowrap; }
.badge.cancelado, .badge.erro { background: var(--coral-soft); color: #A13E38; }
.badge.pendente, .badge.revisar { background: var(--yellow-soft); color: #7A610D; }
.badge.concluido { background: var(--turquoise-soft); color: var(--teal-ink); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 15px 22px; font-size: 10px; color: var(--muted); gap: 15px; }
.pager > div { display: flex; align-items: center; gap: 12px; }
.pager button { padding: 6px 11px; font-size: 11px; }
.footnote { font-size: 11px; color: var(--muted); margin: 16px 0; }
.notice { padding: 12px 16px; border: 1px solid #E8D492; border-radius: 9px; background: var(--yellow-soft); color: #766017; font-size: 12px; }
.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.section-intro p { margin: 0; color: var(--muted); max-width: 650px; }
.section-intro button { flex-shrink: 0; }
.account-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.account-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.account-card header { margin-bottom: 14px; align-items: flex-start; }
.account-card p { margin: 8px 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.account-card .eyebrow { color: var(--teal-ink); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.account-actions button { font-size: 11px; padding: 7px 12px; }
.connection-error { color: var(--red) !important; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.help-grid .panel { margin-top: 0; }
.help-grid p { font-size: 13px; }
.help-grid .eyebrow { font-size: 10px; color: var(--teal-ink); }
.error { color: var(--red); font-size: 12px; white-space: pre-wrap; }
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; background: #fff; }
.auth-brand { position: relative; background: var(--blue-soft); padding: 50px 7vw; color: var(--ink); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border-right: 1px solid #D6EAF6; }
.auth-brand::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(to right, var(--turquoise) 0% 35%, var(--blue) 35% 55%, var(--magenta) 55% 72%, var(--yellow) 72% 86%, var(--coral) 86%); }
.auth-logo { display: block; width: 176px; height: 176px; object-fit: contain; border-radius: 20px; margin-bottom: 32px; background: #fff; }
.auth-brand h1 { font-size: clamp(38px, 3.4vw, 55px); font-weight: 500; margin-bottom: 22px; line-height: 1.1; letter-spacing: -.9px; }
.auth-brand h1 span { color: var(--teal-ink); }
.auth-brand p:not(.eyebrow) { color: #586F7C; font-size: 16px; max-width: 420px; }
.auth-brand .eyebrow { color: var(--teal-ink); }
.auth-brand small { margin-top: 45px; color: #586F7C; }
.channels { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.channels span { border: 1px solid #BDDDED; background: #fff; padding: 5px 10px; border-radius: 7px; color: #526974; font-size: 11px; }
.auth-form { margin: auto; width: min(380px, 80%); display: grid; gap: 20px; padding: 45px 0; }
.auth-form h2 { font-size: 31px; margin: 0; }
.auth-form p { margin: 0; }
.auth-form .eyebrow { color: #954677; }
.auth-form .primary { margin-top: 4px; }
.auth-form label { gap: 9px; }
.auth-form input { padding: 13px; }
dialog { border: 1px solid var(--line); border-radius: 16px; width: min(640px, 94vw); padding: 24px; color: var(--ink); max-height: 90vh; box-shadow: 0 24px 70px #253B5825; }
dialog::backdrop { background: #1D344C70; backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close { background: var(--blue-soft); font-size: 22px; line-height: 1; padding: 7px 11px; color: #476371; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid p { font-size: 12px; color: var(--muted); margin: 0; }
.check { display: flex; flex-direction: row; align-items: center; font-size: 13px; gap: 10px; }
.check input { width: auto; }
.check-list { display: grid; gap: 8px; max-height: 220px; overflow: auto; border: 1px solid var(--line); padding: 12px; border-radius: 8px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 20px; gap: 10px; }
.details-list { padding-left: 20px; font-size: 13px; }
#toast { position: fixed; right: 24px; bottom: 24px; background: #214D53; color: #fff; padding: 15px 22px; border-radius: 10px; box-shadow: 0 8px 24px #214D5330; z-index: 20; max-width: min(480px, 90vw); }
.oauth-link { display: block; word-break: break-all; font-size: 12px; max-height: 120px; overflow: auto; margin-bottom: 18px; }
#credentials-fields { display: contents; }
@media (min-width: 1600px) {
  main { padding-left: 50px; padding-right: 50px; }
}
@media (max-width: 1150px) {
  .shell { grid-template-columns: 205px 1fr; }
  aside { width: 205px; padding: 16px 12px 24px; }
  .wordmark img { width: 166px; height: 166px; }
  nav button { gap: 8px; padding: 12px 8px; }
  main { padding: 26px 23px; }
  .metric-grid { gap: 10px; }
  .metric-grid article { padding: 15px; }
  .metric-grid strong { font-size: 24px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters button { grid-column: 2; }
  .chart-grid { grid-template-columns: 1.35fr 1fr; }
  .status-chip { display: none; }
  .auth-brand { padding: 45px 5vw; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  aside { position: relative; width: auto; padding: 12px 16px 10px; display: grid; grid-template-columns: 82px 1fr auto; gap: 0 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .wordmark { grid-column: 1; grid-row: 1; }
  .wordmark img { width: 80px; height: 80px; }
  .sidebar-product { grid-column: 2; grid-row: 1; align-self: center; text-align: left; padding: 0; }
  .sidebar-product strong { font-size: 21px; }
  .brand-sub { font-size: 8px; letter-spacing: 1px; }
  .local-badge { display: none; }
  .sidebar-footer { grid-column: 3; grid-row: 1; margin: 0; padding: 0; align-self: center; text-align: right; }
  #who { max-width: 100px; font-size: 9px; }
  #logout { font-size: 10px; text-align: right; }
  nav { grid-column: 1 / -1; display: flex; overflow: auto; gap: 5px; margin-top: 5px; padding-bottom: 2px; }
  nav button { white-space: nowrap; padding: 9px; gap: 7px; }
  nav button span { font-size: 11px; }
  nav button svg { width: 16px; height: 16px; flex-basis: 16px; }
  main { padding: 22px 16px; }
  header { gap: 10px; }
  h1 { font-size: 27px; }
  main > header .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .header-actions { gap: 7px; }
  .mode-switch { flex-direction: column; align-items: flex-start; font-size: 10px; gap: 2px; }
  .mode-switch select { width: 130px; font-size: 11px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article > span { font-size: 11px; }
  .metric-grid strong { font-size: clamp(16px, 5vw, 24px); }
  .metric-grid small { font-size: 10px; }
  .chart-grid, .account-grid, .help-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 25px 30px 30px; border-right: 0; border-bottom: 1px solid #D6EAF6; }
  .auth-brand h1 { font-size: 35px; }
  .auth-brand .auth-logo { width: 105px; height: 105px; border-radius: 14px; margin-bottom: 23px; }
  .auth-brand p:not(.eyebrow) { font-size: 14px; margin-bottom: 0; }
  .auth-brand small, .auth-brand .channels { display: none; }
  .auth-form { padding: 36px 0; }
  .pager { align-items: flex-start; flex-direction: column; }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}

/* Account management */
#credentials-fields[hidden] { display: none; }
.account-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.removed-list { display: grid; gap: 12px; }
button.danger { background: #fff1ef; color: #9f342d; border: 1px solid #efc1ba; }
button.danger:hover { background: #ffe6e1; }
#application-source-help { overflow-wrap: anywhere; }

.form-grid .credential-warning { color: #8a3d00; background: #fff8df; border: 1px solid #f0cd73; border-radius: 10px; padding: 12px; overflow-wrap: anywhere; }
