﻿:root {
  color-scheme: light;
  --bg: #f5f7f5;
  --panel: #fff;
  --text: #20372e;
  --muted: #626e67;
  --line: #e5ebe6;
  --accent: #55752f;
  /* Texto sobre fundo de destaque (botão principal). Contraste AA (>= 4,5:1) em todos os temas. */
  --on-accent: #fff;
  --soft: #eff5e8;
  --sidebar: #102f27;
  --blue: #07678b;
  --shadow: 0 12px 35px #153c2510;
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition:
    background 0.18s,
    transform 0.18s;
}
button:hover {
  filter: brightness(1.06);
}
button:active {
  transform: translateY(1px);
}
button.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  padding: 8px;
}
input,
select,
textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  padding: 12px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 31px;
  letter-spacing: -1px;
  font-weight: 650;
  margin-bottom: 9px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.hidden {
  display: none !important;
}
.flex {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.pill {
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.layout {
  display: grid;
  --sidebar-width: clamp(210px, 19vw, 270px);
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  color: #e1ece5;
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 45px;
}
.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: transparent;
}
.brand img.brand-logo {
  flex: 0 0 auto;
}
.brand > div {
  min-width: 0;
}
.brand strong {
  font-size: 17px;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  color: #a7beb1;
  font-size: 10px;
  margin-top: 5px;
  letter-spacing: 2px;
}
.nav-label {
  color: #a9c2b6;
  margin: 0 12px 13px;
  font-size: 9px;
  letter-spacing: 2px;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav a {
  text-decoration: none;
  border-radius: 10px;
  min-height: 44px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: transparent;
  color: #abc2b6;
  font-size: 12px;
  padding: 13px 14px;
}
.nav a.active {
  background: #ffffff12;
  color: #d7eeac;
  box-shadow: inset 3px 0 #a2c66c;
}
.nav a .count {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  background: #ffffff15;
  border-radius: 4px;
}
.nav a .icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: #ffffff12;
  font-size: 15px;
}
.brand strong {
  font-size: 14px;
  letter-spacing: -0.3px;
  line-height: 1.25;
}
.side-bottom {
  margin-top: auto;
  padding-top: 30px;
}
.store-badge {
  padding: 14px 10px;
  border-top: 1px solid #ffffff14;
  border-bottom: 1px solid #ffffff14;
  margin-bottom: 16px;
}
.store-badge img {
  width: 33px;
  height: 33px;
  border-radius: 8px;
}
.store-badge small {
  font-size: 10px;
  color: #9cb4a7;
}
.person {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
}
.person .avatar {
  background: #334e42;
  color: #d8e7cb;
}
.person small {
  display: block;
  margin-top: 4px;
  color: #b9cdc1;
}
.content {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 78px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
}
.breadcrumb span {
  margin: 0 9px;
  color: var(--muted);
}
.top-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.secure {
  font-size: 10px;
  color: var(--muted);
}
.secure:before {
  content: "●";
  color: #7da54d;
  margin-right: 6px;
}
.main {
  max-width: 1450px;
  margin: auto;
  padding: 34px 42px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 29px;
}
.page-head p {
  font-size: 12px;
  margin-bottom: 0;
}
.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.head-actions input {
  width: 175px;
}
.cards {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 27px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 13px;
  position: relative;
  min-height: 135px;
}
.card.featured {
  background: var(--sidebar);
  color: #fff;
  border-color: var(--sidebar);
  overflow: hidden;
}
.card.featured:after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  border: 25px solid #ffffff05;
  border-radius: 50%;
  right: -60px;
  top: 10px;
}
.card-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.featured .card-label {
  color: #bdd0c2;
}
.card-value {
  font-size: 28px;
  letter-spacing: -1px;
  font-weight: 650;
  margin: 17px 0 9px;
  font-variant-numeric: tabular-nums;
}
.card-foot {
  font-size: 10px;
  color: var(--muted);
}
.featured .card-foot {
  color: #accc97;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  overflow: hidden;
}
.panel-heading {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.panel-heading h2 {
  margin-bottom: 5px;
}
.panel-heading p {
  font-size: 11px;
  margin: 0;
  color: var(--muted);
}
.filters {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 0 24px 20px;
}
.search {
  max-width: 290px;
}
.filters select {
  width: 190px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
th {
  background: var(--bg);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 14px 24px;
  border-block: 1px solid var(--line);
}
td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--soft);
}
td .flex {
  gap: 11px;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.amount {
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.table-bottom {
  display: flex;
  justify-content: space-between;
  padding: 17px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.table-bottom strong {
  color: var(--text);
}
.below {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-top: 22px;
}
.insight {
  padding: 23px;
}
.insight p {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}
.store-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.store-row img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.store-row strong {
  font-size: 11px;
}
.store-row .grow {
  flex: 1;
}
.track {
  height: 5px;
  background: var(--line);
  border-radius: 9px;
  margin-top: 8px;
  overflow: hidden;
}
.bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s;
}
.empty {
  text-align: center;
  padding: 55px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  margin-bottom: 9px;
}
.page-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 27px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.login {
  min-height: 100vh;
  background: #0e2b23;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  color: #edf4ee;
}
.login-art {
  padding: 65px 12%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 20% 10%, #335c37 0, transparent 60%),
    linear-gradient(145deg, #193c2b, #0b2524);
  position: relative;
  overflow: hidden;
}
.login-art:after {
  content: "";
  width: 500px;
  height: 500px;
  border: 1px solid #a4c46f22;
  border-radius: 50%;
  position: absolute;
  bottom: -300px;
  left: -70px;
  box-shadow:
    0 0 0 60px #a4c46f05,
    0 0 0 120px #a4c46f04;
}
.login-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 70px;
}
.login-art h1 {
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -2px;
  max-width: 440px;
}
.login-art h1 em {
  font-style: normal;
  color: #acd27a;
}
.login-art p {
  color: #b4c5b7;
  max-width: 350px;
  font-size: 14px;
}
.login-art footer {
  margin-top: auto;
  padding-top: 70px;
  color: #91ad9b;
  font-size: 11px;
}
.login-shops {
  display: flex;
  gap: 18px;
  margin-top: 35px;
}
.login-shops img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}
.login-form-area {
  display: grid;
  place-items: center;
  padding: 45px;
  background: var(--bg);
  color: var(--text);
}
.login-box {
  width: 100%;
  max-width: 380px;
}
.login-box .eyebrow {
  color: var(--accent);
  margin-bottom: 20px;
}
.login-box h2 {
  font-size: 30px;
  margin-bottom: 12px;
}
.login-box p {
  font-size: 12px;
  color: var(--muted);
}
.login-box form {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}
.login-box button {
  padding: 15px;
}
.login-bottom {
  font-size: 10px !important;
  text-align: center;
  margin-top: 20px;
}
.login-theme {
  position: fixed;
  right: 24px;
  top: 22px;
}
.form-error {
  color: #b94e39;
  font-size: 12px;
  line-height: 1.5;
}
dialog {
  width: min(500px, calc(100% - 30px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 25px 90px #0005;
}
dialog::backdrop {
  background: #061c1bc0;
  backdrop-filter: blur(4px);
}
dialog form {
  display: grid;
  gap: 18px;
}
dialog h2 {
  font-size: 23px;
  margin: 0;
}
dialog .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 7px;
}
.dialog-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-card {
  padding: 26px;
}
.settings-card img {
  width: 55px;
  height: 55px;
  border-radius: 11px;
  margin-bottom: 18px;
}
.settings-card form {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}
.settings-card label {
  flex: 1;
}
.settings-card p {
  font-size: 12px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar);
  color: white;
  padding: 14px 23px;
  border: 1px solid #ffffff20;
  border-radius: 11px;
  z-index: 20;
  box-shadow: var(--shadow);
  display: none;
  max-width: 90%;
  font-size: 12px;
}
#toast.show {
  display: block;
}
.menu-backdrop,
.mobile-menu {
  display: none;
}
.report-total {
  background: var(--soft);
  font-weight: 700;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101c18;
  --panel: #172720;
  --text: #e5ede6;
  --muted: #94a79a;
  --line: #2b3c30;
  --accent: #a2c46a;
  --soft: #263726;
  --sidebar: #0b201a;
  --shadow: 0 10px 30px #0002;
  --on-accent: #122217;
}
html[data-theme="dark"] .nav a {
  color: #a6bdaf;
}
html[data-theme="dark"] .nav a.active {
  color: #d8eead;
}
html[data-brand="gelson"] {
  --accent: #347a29;
  --soft: #eaf3e6;
  --sidebar: #123f5c;
  --blue: #124665;
}
html[data-brand="gelson"][data-theme="dark"] {
  --accent: #83c94a;
  --soft: #203a35;
  --bg: #101e28;
  --panel: #172b37;
  --line: #2b414b;
  --text: #e7eff2;
  --muted: #97acb5;
  --sidebar: #0d2d43;
}
html[data-brand="griffe"] {
  --accent: #56761f;
  --sidebar: #203d31;
}
html[data-brand="griffe"][data-theme="dark"] {
  --accent: #b0cf73;
  --sidebar: #142c23;
}
@media (min-width: 1500px) {
  .main {
    padding-top: 45px;
  }
  .card {
    min-height: 150px;
  }
  td {
    padding-block: 19px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    padding: 27px 16px;
  }
  .main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .page-head {
    align-items: flex-start;
  }
  .head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  th,
  td {
    padding-inline: 17px;
  }
  .below {
    grid-template-columns: 1fr;
  }
  .secure {
    display: none;
  }
}
@media (max-width: 720px) {
  .layout {
    display: block;
  }
  .sidebar {
    z-index: 12;
    width: min(280px, calc(100% - 48px));
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    visibility: visible;
    transform: translateX(0);
  }
  .content {
    width: 100%;
  }
  .mobile-menu {
    display: inline-block;
  }
  .menu-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 11;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: #0006;
  }
  .topbar {
    height: 65px;
    padding: 0 18px;
  }
  .main {
    padding: 24px 16px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .page-head {
    flex-direction: column;
    gap: 18px;
  }
  .head-actions {
    width: 100%;
    justify-content: space-between;
  }
  .head-actions input {
    width: 150px;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 17px;
    min-height: 125px;
  }
  .card-value {
    font-size: 24px;
  }
  .card-label {
    font-size: 10px;
  }
  .card-foot {
    font-size: 9px;
  }
  h1 {
    font-size: 27px;
  }
  .filters {
    padding: 0 16px 16px;
    flex-wrap: wrap;
    gap: 9px;
  }
  .filters .search {
    max-width: none;
    flex: 1;
    min-width: 160px;
  }
  .filters select {
    width: 140px;
  }
  .panel-heading {
    padding: 19px 16px;
    align-items: flex-start;
  }
  .panel-heading button {
    font-size: 10px;
    padding: 9px 12px;
  }
  .page-foot {
    gap: 15px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    padding: 28px 25px;
  }
  .login-logo {
    width: 65px;
    height: 65px;
    margin-bottom: 24px;
  }
  .login-art h1 {
    font-size: 34px;
    max-width: 330px;
  }
  .login-art p,
  .login-shops,
  .login-art footer {
    display: none;
  }
  .login-form-area {
    padding: 35px 25px;
    min-height: 65vh;
  }
  .login-theme {
    top: 18px;
    right: 16px;
  }
  .login-art .eyebrow {
    margin-bottom: 12px;
  }
  .below {
    gap: 14px;
  }
  .table-bottom {
    padding-inline: 16px;
  }
  .settings-card form {
    flex-wrap: wrap;
  }
}
@media print {
  .sidebar,
  .topbar,
  .head-actions,
  .filters,
  .page-foot,
  button {
    display: none !important;
  }
  .layout {
    display: block;
  }
  .main {
    padding: 0;
  }
  .panel {
    border: 0;
  }
  .table-wrap {
    overflow: visible;
  }
  body {
    background: #fff;
    color: #000;
  }
  .cards {
    display: none;
  }
  th,
  td {
    color: #000 !important;
    background: white !important;
    padding: 10px;
  }
  .page-head p {
    display: block;
  }
}
/* ---------- Seletores modernos ---------- */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2378867e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) 50%;
}
select:hover,
input:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
input:focus,
select:focus,
textarea:focus {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.filters {
  flex-wrap: wrap;
}
.filters .select-wrap {
  display: block;
  width: 220px;
}
.filters .select-wrap select {
  width: 100%;
}
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.segmented button {
  background: transparent;
  color: var(--text);
  padding: 9px 16px;
  min-height: 38px;
  border-radius: 9px;
  white-space: nowrap;
}
.segmented button.on {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 2px 8px #0000001a;
}
.pill.big {
  font-size: 12px;
  padding: 10px 14px;
}
.month-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  min-height: 46px;
}
.month-stepper button.ghost {
  font-size: 20px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}
.month-stepper {
  position: relative;
}
.month-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 150px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.month-label:hover,
.month-label[aria-expanded="true"] {
  background: var(--soft, rgba(0, 0, 0, 0.05));
}
.month-label span:first-letter {
  text-transform: uppercase;
}
.month-label i {
  font-style: normal;
  font-size: 11px;
  opacity: 0.6;
}
.month-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}
.month-pop.hidden {
  display: none;
}
.day-weekdays,
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.day-weekdays {
  margin: 10px 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.day-weekdays span {
  padding: 5px 0;
}
.day-cell,
.day-empty {
  width: 32px;
  height: 32px;
  justify-self: center;
}
.day-cell {
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.day-cell:hover:not(:disabled) {
  background: var(--soft);
}
.day-cell.today {
  outline: 1px solid var(--accent);
}
.day-cell.selected {
  background: var(--accent);
  color: #fff;
}
.day-cell:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0;
}
.month-cell {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-transform: capitalize;
  cursor: pointer;
}
.month-cell.today {
  border-color: var(--accent, currentColor);
}
.month-cell.selected {
  background: var(--accent, #222);
  border-color: var(--accent, #222);
  color: #fff;
}
.month-cell:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #777);
}
tr.inactive td {
  opacity: 0.55;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pager strong {
  color: var(--text);
}
.pager button {
  min-height: 44px;
}
.note-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-actions {
  width: 52px;
}
.row-actions button {
  min-width: 40px;
  min-height: 40px;
}
.field {
  display: grid;
  gap: 8px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
}
.optional {
  color: var(--muted);
  font-weight: 500;
}
.counter {
  justify-self: end;
  color: var(--muted);
  font-weight: 500;
  font-size: 10px;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.readonly-field {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px dashed var(--line);
  font-size: 13px;
}
.readonly-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
dialog {
  max-height: 94vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
dialog::-webkit-scrollbar {
  display: none;
}
/* ---------- Calendário ---------- */
.calendar {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
  min-height: 300px;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cal-head strong:first-letter {
  text-transform: uppercase;
}
.cal-head button.ghost {
  font-size: 20px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-week {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}
.cal-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 38px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.cal-day:hover:not(:disabled) {
  background: var(--soft);
}
.cal-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.cal-day.today {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.cal-day.marked:after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}
html .cal-day.selected {
  background: var(--accent);
  color: #fff;
}
.cal-day.selected:after {
  background: #fff;
}
.cal-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
button.chip-btn {
  background: var(--soft);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 12px;
  min-height: 36px;
}
.cal-legend {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
/* ---------- Cadastros ---------- */
.registry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}
.settings-card img {
  object-fit: contain;
  margin-bottom: 0;
}
.settings-card h3 {
  margin: 22px 0 10px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 4px 12px;
  border-radius: 99px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 650;
  font-size: 12px;
}
.chip.off {
  background: var(--bg);
  color: var(--muted);
  text-decoration: line-through;
}
.chip button.ghost {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 99px;
  font-size: 11px;
}
button.small {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 99px;
}
.demo-tag {
  color: var(--accent) !important;
}
html[data-theme="dark"] .cal-day:not(.selected),
html[data-theme="dark"] .segmented button,
html[data-theme="dark"] button.chip-btn {
  color: var(--text);
}
html[data-theme="dark"] .segmented button.on,
html[data-theme="dark"] button.chip-btn {
  color: var(--accent);
}
@media (max-width: 720px) {
  .segmented {
    width: 100%;
    overflow-x: auto;
  }
  .segmented button {
    flex: 1;
  }
  .filters .select-wrap {
    width: 100%;
  }
  .month-stepper {
    flex: 1;
    justify-content: space-between;
  }
  .head-actions {
    flex-wrap: wrap;
  }
  .head-actions > button {
    flex: 1;
    white-space: nowrap;
  }
  table.responsive thead {
    display: none;
  }
  table.responsive,
  table.responsive tbody,
  table.responsive tr,
  table.responsive td {
    display: block;
    width: 100%;
    white-space: normal;
  }
  table.responsive tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    position: relative;
  }
  table.responsive td {
    border: 0;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  table.responsive td[data-label]:before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
  }
  table.responsive td:first-child {
    font-weight: 650;
    padding-right: 48px;
  }
  table.responsive td:first-child:before {
    display: none;
  }
  table.responsive .row-actions {
    position: absolute;
    right: 8px;
    top: 8px;
    width: auto;
    padding: 0;
  }
  table.responsive td[colspan] {
    display: block;
  }
  .note-cell {
    max-width: none;
  }
  .pager {
    flex-wrap: wrap;
    padding: 14px 16px;
  }
  .pager span {
    order: -1;
    width: 100%;
    text-align: center;
  }
  .pager button {
    flex: 1;
  }
  dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px;
    max-height: 92vh;
  }
  dialog .form-grid {
    grid-template-columns: 1fr;
  }
  .registry {
    grid-template-columns: 1fr;
  }
  .dialog-actions button {
    flex: 1;
  }
}
@media print {
  .pager {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .month-pop {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    transform: none;
    border-radius: 18px 18px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .month-label {
    flex: 1;
  }
}

/* Paginação compacta (7 itens) do relatório e dos cadastros */
.pager-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  color: var(--muted);
  font-size: 13px;
}
.pager-mini button {
  min-height: 40px;
}
@media (max-width: 560px) {
  .pager-mini {
    justify-content: center;
  }
  .pager-mini span {
    order: -1;
    width: 100%;
    text-align: center;
  }
  .pager-mini button {
    flex: 1;
  }
}

/* Barra lateral (fundo escuro em todos os temas): textos e botões sem fundo ficam claros. */
.sidebar .muted {
  color: #a2c66c;
}
.sidebar button.ghost {
  color: #e1ece5;
}

.registry + .panel {
  margin-top: 22px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.preview-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.preview-toolbar select {
  min-height: 38px;
}
.preview-toolbar a {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 420px) {
  .topbar {
    padding-inline: 12px;
    gap: 8px;
  }
  .top-actions {
    gap: 8px;
    flex-shrink: 0;
  }
  .preview-toolbar > label {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

