:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #23372f;
  background: #f7f8f4;
  font-synthesis: none;
  --green: #284c3c;
  --muted: #748078;
  --line: #e1e6df;
  --paper: #fff;
  --accent: #e5ad67;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #cd994e;
  outline-offset: 3px;
}
.sidebar {
  width: 248px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 38px 24px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1.5;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-logo {
  position: absolute;
  width: 175%;
  height: auto;
  max-width: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.nav-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin: 28px 12px 18px;
}
nav {
  display: grid;
  gap: 7px;
}
nav a {
  display: flex;
  gap: 14px;
  text-decoration: none;
  padding: 15px 14px;
  border-radius: 9px;
  font-size: 13px;
  color: #647168;
}
nav a span {
  width: 18px;
  font-size: 18px;
  text-align: center;
  line-height: 18px;
}
nav a .icon {
  color: #96a39a;
}
nav a.active .icon {
  color: var(--accent);
}
nav a.active {
  background: #eaf0e8;
  color: var(--green);
  font-weight: 650;
}
nav a:hover {
  background: #f2f5ef;
}
.sidebar-foot {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.8;
  color: #586b5e;
  padding: 10px;
}
.sidebar-foot > span:last-child {
  display: block;
  font-size: 10px;
  color: #8b958d;
  margin-left: 13px;
}
.small-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a5ad7d;
  margin-right: 5px;
}
main {
  margin-left: 248px;
  max-width: 1600px;
  padding: 0 48px;
}
.topbar {
  height: 88px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  letter-spacing: 1px;
}
.topbar .muted {
  margin: 0 14px;
}
.top-date {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}
#view {
  min-height: 75vh;
  padding: 40px 0;
}
h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1.2px;
  font-weight: 600;
  margin: 0 0 12px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #8b7355;
  margin-bottom: 14px;
}
.subtitle,
.muted {
  color: var(--muted);
}
.subtitle {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  max-width: 620px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  min-height: 44px;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.button.danger {
  color: #a44739;
}
.button.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 11px;
}
.icon-button {
  padding: 7px 12px;
  font-size: 19px;
  min-width: 42px;
}
.date-picker {
  display: flex;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  align-items: center;
}
.date-picker .icon-button {
  border: 0;
  min-height: 34px;
}
.date-picker input {
  border: 0 !important;
  padding: 8px !important;
  width: 145px !important;
  min-height: 36px !important;
  font-size: 12px;
}
.routine-note {
  background: #eef2e9;
  padding: 15px 20px;
  border-radius: 9px;
  font-size: 12px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 24px;
  line-height: 1.6;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  padding: 6px 0 28px;
  margin-bottom: 32px;
}
.metric {
  padding: 6px 30px;
  border-left: 1px solid var(--line);
}
.metric:first-child {
  padding-left: 0;
  border-left: 0;
}
.metric-label {
  font-size: 12px;
  color: #7b847d;
}
.metric strong {
  font-size: 43px;
  font-weight: 500;
  letter-spacing: -2px;
  display: block;
  margin-top: 10px;
}
.metric small {
  color: var(--muted);
  font-size: 10px;
}
/* Colunas iguais: com 1.25fr de um lado, os dois blocos começavam na mesma
   altura mas terminavam em larguras diferentes, e a tela parecia torta. */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid #edf0ea;
}
.panel-body {
  padding: 22px 24px;
}
.panel-head h2 {
  font-size: 16px;
}
.tag {
  font-size: 10px;
  padding: 5px 9px;
  border-radius: 5px;
  background: #f1f3ee;
  color: #6e7c70;
  white-space: nowrap;
}
.tag.green {
  background: #eaf2e7;
  color: #3c6d44;
}
.tag.amber {
  background: #fbefd9;
  color: #946e2e;
}
.tag.red {
  background: #f9e7e2;
  color: #a14838;
}
.total-row {
  padding: 18px 24px;
  border-bottom: 1px solid #f0f2ed;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
}
.total-row:last-child {
  border: 0;
}
.total-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.total-row strong {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
.order {
  padding: 19px 24px;
  border-bottom: 1px solid #edf0ea;
}
.order:last-child {
  border: 0;
}
.order-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.order-lines {
  font-size: 12px;
  line-height: 1.8;
  color: #6c776e;
}
.group-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.group-list li {
  padding: 13px 24px;
  border-bottom: 1px solid #f0f2ed;
  font-size: 12px;
}
.group-list li:last-child {
  border: 0;
}
.empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.empty strong {
  display: block;
  color: #4c6052;
  margin-bottom: 5px;
  font-weight: 500;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #fafbf8;
  color: #7c897f;
  padding: 16px 20px;
  font-weight: 500;
  white-space: nowrap;
}
td {
  padding: 18px 20px;
  border-top: 1px solid #edf0ea;
  vertical-align: middle;
}
td strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
td small {
  font-size: 11px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.toolbar input {
  max-width: 320px;
}
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 550;
}
.field small,
.help {
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  line-height: 1.7;
}
input:not([type="checkbox"]),
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  min-height: 44px;
  border: 1px solid #dce2d8;
  border-radius: 7px;
  background: #fff;
  color: #263e30;
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}
input[type="checkbox"] {
  accent-color: var(--green);
  width: 17px;
  height: 17px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  min-height: 36px;
}
.days {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 8px 0 22px;
}
.day {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 11px;
  min-height: 40px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.preview {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.8;
  border-radius: 10px 10px 10px 0;
  background: #eef3e9;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.preview-label {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #7b8579;
  margin-bottom: 10px;
}
.section-space {
  margin-bottom: 25px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
legend {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.sticky-save {
  position: sticky;
  bottom: 16px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 5px 20px #263f340a;
}
.connection-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
}
.connection-icon {
  width: 70px;
  height: 70px;
  background: #eaf0e7;
  color: var(--green);
  font-size: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 0 auto 20px;
}
.connection-card h2 {
  font-size: 25px;
  margin: 15px 0;
}
.connection-card .subtitle {
  margin: 0 auto 24px;
}
.connection-card .actions {
  justify-content: center;
}
.qr {
  display: block;
  width: 260px;
  max-width: 100%;
  margin: 24px auto;
  image-rendering: pixelated;
}
.connection-details {
  margin: 28px 0;
  text-align: left;
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.connection-details div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.connection-details dt {
  color: var(--muted);
}
.connection-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #8c958b;
  display: flex;
  justify-content: space-between;
}
#notice {
  margin-top: 18px;
  padding: 13px 18px;
  border-radius: 8px;
  background: #e6eee0;
  font-size: 13px;
}
#notice.error {
  background: #f7e4dd;
  color: #904738;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: min(620px, calc(100% - 28px));
  max-height: 90vh;
  padding: 0;
  color: #263d30;
  box-shadow: 0 25px 90px #12231733;
}
dialog::backdrop {
  background: #172b2370;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
#dialog-body {
  padding: 24px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.contact-select {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 16px 0;
}
.contact-select label {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  align-items: center;
}
.contact-select small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.alert {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7;
}
.alert strong {
  display: block;
}
.alert .actions {
  margin-top: 10px;
}
.skip {
  position: fixed;
  top: -60px;
  background: white;
  padding: 15px;
  z-index: 10;
}
.skip:focus {
  top: 0;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1450px) {
  main {
    padding: 0 70px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 215px;
    padding: 30px 16px;
  }
  main {
    margin-left: 215px;
    padding: 0 28px;
  }
  .grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
  }
  .metric {
    padding: 6px 20px;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 20px 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    width: 150px;
    /* Centralizada: no celular a barra lateral vira um cabeçalho, e a logo
       encostada na esquerda ficava torta em relação ao resto. */
    margin: 0 auto;
  }
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 3px;
    margin-top: 20px;
    padding-bottom: 10px;
  }
  nav a {
    white-space: nowrap;
    padding: 11px 12px;
    font-size: 11px;
    min-height: 44px;
    gap: 7px;
  }
  nav a span {
    font-size: 15px;
    width: auto;
  }
  main {
    margin-left: 0;
    padding: 0 20px;
  }
  .topbar {
    height: 52px;
    font-size: 8px;
  }
  .top-date {
    font-size: 10px;
  }
  .topbar .muted {
    margin: 0 7px;
  }
  #view {
    padding: 28px 0;
  }
  h1 {
    font-size: 29px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .page-heading {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
  }
  .page-heading > .actions {
    width: 100%;
  }
  .metrics {
    padding-bottom: 23px;
    margin-bottom: 24px;
  }
  .metric {
    padding: 4px 14px;
  }
  .metric strong {
    font-size: 35px;
  }
  .metric-label {
    font-size: 10px;
    line-height: 1.5;
  }
  .metric small {
    font-size: 9px;
  }
  .routine-note {
    flex-direction: column;
    padding: 13px 16px;
    font-size: 11px;
    gap: 3px;
  }
  .grid,
  .settings-grid {
    gap: 0;
  }
  .panel-head,
  .panel-body {
    padding: 19px;
  }
  .panel-head h2 {
    font-size: 15px;
  }
  .connection-card {
    padding: 28px 20px;
  }
  .form-row {
    gap: 12px;
  }
  .day {
    padding: 5px 7px;
    font-size: 10px;
  }
  .days {
    gap: 5px;
  }
  .sticky-save {
    bottom: 8px;
  }
  .sticky-save .help {
    max-width: 50%;
  }
  footer span {
    display: none;
  }
  .toolbar input {
    max-width: 100%;
  }
  td,
  th {
    padding: 14px;
  }
  .button {
    min-height: 44px;
  }
  .button.small {
    min-height: 40px;
  }
}

/* ── ícones ─────────────────────────────────────────────────────────── */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── entrada ────────────────────────────────────────────────────────── */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(760px 480px at 50% -10%, #eef2ea, transparent 70%),
    #f7f8f4;
}
.login-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 40px 34px 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px #16281e14;
}
.login-logo {
  width: 132px;
  height: auto;
}
.login-card h1 {
  margin: 0;
  font-size: 19px;
  color: var(--green);
}
.login-help {
  margin: -8px 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.login-field {
  position: relative;
  width: 100%;
}
.login-field .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.login-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fcfdfb;
  color: inherit;
  font-size: 14px;
}
.login-submit {
  width: 100%;
  min-height: 48px;
}
.login-error {
  margin: 0;
  font-size: 12px;
  color: #a44739;
}

/* ── topo ───────────────────────────────────────────────────────────── */

.topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* ── ajustes em cartões ─────────────────────────────────────────────── */

.setting-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f3ee;
  font-size: 13px;
}
.setting-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.setting-line:first-child {
  padding-top: 0;
}
.setting-name {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.setting-value {
  text-align: right;
  color: #33473c;
}
.setting-value small {
  color: var(--muted);
}
/* Frase comprida não se lê alinhada à direita: mensagem vira bloco. */
.setting-line.texto {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
.setting-line.texto .setting-value {
  text-align: left;
  line-height: 1.7;
  color: var(--muted);
}

/* ── tela Hoje: blocos de tamanho igual ─────────────────────────────── */

/* Quatro em linha, ou dois por dois. Com `auto-fit` a largura intermediária
   deixava três em cima e um sozinho embaixo, que é o tipo de sobra que dá
   a impressão de tela desalinhada. */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}
@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 124px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
}
.stat strong {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -1.6px;
  line-height: 1;
}
/* Empurrado para o fim: assim a linha de ajuda fica na mesma altura em
   todos os cartões, por mais comprido que seja o rótulo de cima. */
.stat small {
  margin-top: auto;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}
.situation {
  padding: 15px 24px;
  border-bottom: 1px solid #f0f2ed;
}
.situation:last-child {
  border-bottom: 0;
}
.situation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}
.situation-names {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.situation .setting-line,
.panel-body > .setting-line:first-child {
  padding-top: 0;
}

/* ── rotina de hoje ─────────────────────────────────────────────────── */

.routine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.routine-task {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.routine-name {
  font-size: 11px;
  color: var(--muted);
}
.routine-task strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.routine-task small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.routine-task small.ok {
  color: #3c6d44;
}
/* O motivo de a tarefa não ter acontecido é a informação mais importante
   da tela no dia em que ela não acontece. */
.routine-task small.alerta {
  color: #a14838;
  font-weight: 600;
}
@media (max-width: 720px) {
  .routine-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* A prévia desenha os botões como o cliente os vê, em vez de listá-los
   numerados: a mensagem enviada não leva mais as opções por escrito. */
.preview-texto {
  display: block;
}
.preview-botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dde6d6;
}
.preview-botao {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  color: #1c7a5a;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}
.routine-task .button {
  align-self: flex-start;
  margin-top: 10px;
}

/* Sem webhook a padaria envia mas não recebe — e a tela precisa gritar. */
.aviso-webhook {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 9px;
  background: #fbefd9;
  color: #7a5a22;
  line-height: 1.7;
}
.aviso-webhook code {
  font-size: 11px;
  word-break: break-all;
}
.connection-details .ruim {
  color: #a14838;
}
