:root {
  --topbar-height: 64px;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --line: #d9e1ea;
  --line-strong: #b8c4d2;
  --text: #17212b;
  --muted: #637083;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --danger: #c2410c;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --shadow: 0 18px 45px rgba(21, 35, 51, 0.10);
  --font-sans: "Roboto", Arial, sans-serif;
  --font-display: "Roboto", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "sidebar main";
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}

.login-biometric-submit {
  width: 100%;
}

.login-biometric-message,
.field-help {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-biometric-message.error,
.field-help.error { color: #b4232c; }
.field-help.success { color: #087a68; }

.professional-biometry { padding-bottom: 4px; }

.biometry-photo-layout {
  display: grid;
  grid-template-columns: 220px minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}

.biometry-photo-frame {
  position: relative;
  display: grid;
  width: 220px;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  color: #64768a;
  background: #eef3f6;
  border: 1px solid #cbd6e0;
  border-radius: 7px;
}

.biometry-photo-frame img,
.biometry-photo-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.biometry-photo-frame video { transform: scaleX(-1); }
.biometry-photo-controls { max-width: 620px; }

.biometry-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.biometry-remove-photo { margin-top: 14px; }
.biometry-access-heading { margin-top: 26px; }

.biometry-access-panel {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  background: #f4f8fa;
  border: 1px solid #d4dfe7;
  border-radius: 7px;
}

.biometry-access-panel strong,
.biometry-access-panel small,
.field-caption { display: block; }

.field-caption {
  margin-bottom: 4px;
  color: #5f7184;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.biometry-access-panel small {
  margin-top: 4px;
  color: #66798a;
}

.muted-panel { color: #66798a; }

.warning-panel {
  color: #7f5d12;
  background: #fff9e8;
  border-color: #ead9a2;
}

.danger-outline {
  color: #a3262d;
  border-color: #d9a2a7;
}

@media (max-width: 720px) {
  .biometry-photo-layout { grid-template-columns: 1fr; }
  .biometry-photo-frame { width: min(100%, 360px); }
  .biometry-access-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

body.sidebar-collapsed .app-layout {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #17212b;
  color: #e5edf5;
  font-family: "Nunito", sans-serif;
  overflow-y: auto;
}

.system-topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: var(--topbar-height);
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 9px 18px;
  box-shadow: 0 4px 18px rgba(21, 35, 51, 0.06);
}

.topbar-spacer {
  min-width: 0;
}

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.topbar-branch-form {
  margin: 0;
}

.topbar-branch-form label,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-branch-form span,
.topbar-user span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-branch-form select {
  width: min(300px, 32vw);
  min-height: 36px;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}

.topbar-user {
  min-width: 180px;
  max-width: 320px;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 2px 0 2px 14px;
}

.topbar-user strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 74px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 0 12px 0 18px;
}

.sidebar-brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}

.sidebar-brand-link span {
  color: #5eead4;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-toggle {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.side-nav {
  display: grid;
  gap: 12px;
  padding: 16px 12px 24px;
}

.sidebar-context {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding: 12px;
}

.sidebar-config {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  place-items: center;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #e5edf5;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
}

.sidebar-config:hover,
.sidebar-config.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-branch-form {
  margin-bottom: 10px;
}

.sidebar-branch-locked {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.18);
  padding: 10px;
}

.sidebar-branch-locked span {
  color: #99f6e4;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-branch-locked strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-branch-form label {
  display: grid;
  gap: 6px;
}

.sidebar-branch-form span {
  color: #99f6e4;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-branch-form select {
  min-height: 38px;
  border-color: rgba(94, 234, 212, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-branch-form option {
  color: #17212b;
}

.sidebar-user {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.18);
  padding: 10px;
}

.sidebar-user span {
  color: #99f6e4;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-user strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer .nav-home {
  margin-left: 0;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-title,
.nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 10px;
  color: inherit;
  font-family: "Nunito", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.nav-title {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.nav-toggle {
  justify-content: space-between;
}

.nav-toggle::after {
  content: "▾";
  color: #94a3b8;
  font-size: 12px;
  transition: transform 0.16s ease;
}

.nav-group.open .nav-toggle::after {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  gap: 4px;
}

.nav-group.open .submenu {
  display: grid;
}

.nav-single {
  color: #f8fafc;
}

.collapsed-menu-icon {
  display: none;
}

.collapsed-menu-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-config .collapsed-menu-icon {
  display: grid;
  place-items: center;
}

.sidebar-config .nav-label {
  display: none;
}

.nav-link {
  margin-left: 10px;
  color: #aebdcc;
  font-weight: 700;
}

.nav-link:hover,
.nav-single:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-link.active,
.nav-single.active {
  background: var(--primary);
  color: #fff;
}

.nav-subgroup {
  display: grid;
  gap: 4px;
}

.nav-subtoggle {
  width: calc(100% - 10px);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  justify-content: space-between;
}

.nav-subtoggle::after {
  content: "▾";
  color: #94a3b8;
  font-size: 11px;
  transition: transform 0.16s ease;
}

.nav-subgroup.open .nav-subtoggle::after {
  transform: rotate(180deg);
}

.nested-submenu {
  display: none;
  gap: 3px;
}

.nav-subgroup.open .nested-submenu {
  display: grid;
}

.nested-link {
  margin-left: 24px;
  min-height: 34px;
  font-family: "Nunito", sans-serif;
  font-size: 13px;
}

body.sidebar-collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 86px;
  padding: 12px 0;
}

body.sidebar-collapsed .side-nav {
  justify-items: center;
  gap: 14px;
  padding: 14px 0 24px;
}

body.sidebar-collapsed .nav-group {
  justify-items: center;
}

body.sidebar-collapsed .sidebar-brand-link span,
body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-subtoggle,
body.sidebar-collapsed .nav-single {
  overflow: hidden;
  width: 37px;
  min-height: 37px;
  padding-right: 0;
  padding-left: 0;
  justify-content: center;
  text-indent: 0;
}

body.sidebar-collapsed .sidebar-brand-link {
  width: 37px;
  height: 37px;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-brand-link span {
  display: none;
}

body.sidebar-collapsed .sidebar-logo {
  width: 44px;
  height: 44px;
}

body.sidebar-collapsed .nav-link {
  margin-left: 0;
}

body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-subtoggle,
body.sidebar-collapsed .nav-single,
body.sidebar-collapsed .sidebar-config,
body.sidebar-collapsed .sidebar-user,
body.sidebar-collapsed .sidebar-branch-form {
  border: 1px solid rgba(45, 212, 191, 0.42);
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  color: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

body.sidebar-collapsed .nav-title:hover,
body.sidebar-collapsed .nav-link:hover,
body.sidebar-collapsed .nav-subtoggle:hover,
body.sidebar-collapsed .nav-single:hover,
body.sidebar-collapsed .sidebar-config:hover,
body.sidebar-collapsed .sidebar-user:hover,
body.sidebar-collapsed .sidebar-branch-form:hover {
  border-color: rgba(94, 234, 212, 0.72);
  background: rgba(20, 184, 166, 0.24);
  transform: translateY(-1px);
}

body.sidebar-collapsed .nav-title.active,
body.sidebar-collapsed .nav-link.active,
body.sidebar-collapsed .nav-subtoggle.active,
body.sidebar-collapsed .nav-single.active,
body.sidebar-collapsed .sidebar-config.active {
  border-color: rgba(153, 246, 228, 0.90);
  background: rgba(15, 118, 110, 0.52);
}

body.sidebar-collapsed .sidebar-user {
  display: grid;
  width: 37px;
  height: 37px;
  margin: 0 auto 10px;
  place-items: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-user span,
body.sidebar-collapsed .sidebar-user strong {
  display: none;
}

body.sidebar-collapsed .sidebar-user::before {
  content: "\25C9";
  color: #e5edf5;
  font-size: 18px;
  line-height: 1;
  text-indent: 0;
}

body.sidebar-collapsed .sidebar-config {
  width: 37px;
  height: 37px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.14);
  text-indent: 0;
}

body.sidebar-collapsed .sidebar-config::before {
  content: none;
}

body.sidebar-collapsed .collapsed-menu-icon {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #e5edf5;
  text-indent: 0;
}

body.sidebar-collapsed .collapsed-menu-icon svg {
  width: 19px;
  height: 19px;
}

body.sidebar-collapsed .nav-label {
  display: none;
}

body.sidebar-collapsed .sidebar-branch-form {
  display: grid;
  width: 37px;
  height: 37px;
  margin: 0 auto 10px;
  place-items: center;
}

body.sidebar-collapsed .sidebar-branch-form label,
body.sidebar-collapsed .sidebar-branch-form select {
  display: none;
}

body.sidebar-collapsed .sidebar-branch-form::before {
  content: "\25A4";
  color: #e5edf5;
  display: block;
  font-size: 17px;
  line-height: 1;
  text-indent: 0;
}

body.sidebar-collapsed .submenu,
body.sidebar-collapsed .nested-submenu {
  display: none;
}

body.sidebar-collapsed .nav-toggle::after {
  content: none;
}

body.sidebar-collapsed .nav-title::first-letter,
body.sidebar-collapsed .nav-link::first-letter {
  text-indent: 0;
}

body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-subtoggle,
body.sidebar-collapsed .nav-single {
  color: transparent;
}

body.sidebar-collapsed .nav-title::before,
body.sidebar-collapsed .nav-link::before,
body.sidebar-collapsed .nav-subtoggle::before,
body.sidebar-collapsed .nav-single::before {
  content: none !important;
}

body.sidebar-collapsed .nav-subtoggle::after {
  content: none;
}

/* Menu lateral no padrao visual do Genesys Web 2.0 */
.app-layout {
  grid-template-columns: 252px minmax(0, 1fr);
  transition: grid-template-columns 0.2s ease;
}

body.sidebar-collapsed .app-layout {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar {
  border-right-color: #233844;
  background: #12222d;
  color: #aebdc8;
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

.sidebar-brand {
  min-height: 58px;
  gap: 8px;
  border-bottom-color: #233844;
  padding: 0 12px;
}

.sidebar-brand-link {
  flex: 1;
  gap: 10px;
  color: #e5ffff;
}

.sidebar-logo {
  width: 30px;
  height: 30px;
}

.sidebar-brand-link span {
  overflow: hidden;
  color: #e5ffff;
  font-size: 15px;
  font-weight: 800;
  text-transform: none;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  border-color: #39505d;
  border-radius: 6px;
  background: #21343f;
  color: #d9e6ec;
  font-size: 23px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sidebar-toggle:hover {
  border-color: #587080;
  background: #28414d;
  color: #fff;
}

.side-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: 12px 10px 18px;
  scrollbar-color: #38515e transparent;
  scrollbar-width: thin;
}

.sidebar-footer {
  border-top-color: #233844;
  background: #10212b;
  padding: 10px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-title,
.nav-link,
.sidebar-config {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aebdc8;
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-title {
  min-height: 44px;
  padding: 0 10px;
  color: #c7d4dc;
  cursor: pointer;
}

.nav-link,
.sidebar-config {
  padding: 0 10px;
}

.nav-title:hover,
.nav-link:hover,
.sidebar-config:hover {
  background: #1a303b;
  color: #fff;
}

.nav-title.active,
.nav-link.active,
.sidebar-config.active {
  background: #1c514d;
  color: #fff;
  box-shadow: inset 3px 0 0 #54c8b7;
}

.nav-title .collapsed-menu-icon,
.sidebar-footer .collapsed-menu-icon {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
  border: 0;
  border-radius: 6px;
  background: #1b3540;
  color: #bfe8e3;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-title.active .collapsed-menu-icon,
.nav-link.active .collapsed-menu-icon,
.sidebar-config.active .collapsed-menu-icon {
  background: var(--primary);
  color: #fff;
}

.collapsed-menu-icon svg {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  justify-content: flex-start;
}

.nav-toggle::after,
.nav-subtoggle::after {
  margin-left: auto;
  color: #8fa3af;
  font-size: 14px;
  transition: transform 0.18s ease;
}

.nav-group.open .nav-toggle::after,
.nav-subgroup.open .nav-subtoggle::after {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 7px 25px;
  padding: 3px 0 3px 15px;
  border-left: 1px solid #36515f;
}

.nav-group.open .submenu {
  display: flex;
}

.nav-link {
  position: relative;
  min-height: 34px;
  margin: 0;
  overflow: hidden;
  color: #c5d7e8;
  font-size: 13px;
}

.submenu > .nav-link::before,
.nav-subgroup > .nav-link::before {
  position: absolute;
  left: -19px;
  width: 7px;
  height: 7px;
  border: 2px solid #12222d;
  border-radius: 50%;
  background: #36515f;
  content: "";
}

.submenu > .nav-link.active::before,
.nav-subgroup > .nav-link.active::before {
  background: #65d5c5;
}

.nav-link:hover {
  background: #1a303b;
}

.nav-link.active {
  background: var(--primary);
  font-weight: 900;
  box-shadow: none;
}

.nav-subgroup {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-subtoggle {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: #c5d7e8;
  cursor: pointer;
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.nested-submenu {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #36515f;
}

.nav-subgroup.open .nested-submenu {
  display: flex;
}

.nested-link {
  min-height: 30px;
  margin-left: 0;
  padding-left: 12px;
  font-size: 12px;
}

.nested-link::before {
  left: -16px;
  width: 6px;
  height: 6px;
}

.sidebar-footer .nav-home,
.sidebar-footer .nav-logout {
  margin-left: 0;
}

.sidebar-config {
  height: auto;
  margin: 2px 0;
  place-items: initial;
  font-size: 14px;
}

.sidebar-config .nav-label {
  display: inline;
}

body.sidebar-collapsed .sidebar {
  width: 72px;
}

body.sidebar-collapsed .sidebar-brand {
  position: relative;
  min-height: 58px;
  flex-direction: row;
  justify-content: center;
  padding: 0 10px;
}

body.sidebar-collapsed .sidebar-brand-link {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-brand-link span,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-config .nav-label,
body.sidebar-collapsed .submenu,
body.sidebar-collapsed .nested-submenu,
body.sidebar-collapsed .nav-toggle::after,
body.sidebar-collapsed .nav-subtoggle::after {
  display: none;
}

body.sidebar-collapsed .sidebar-logo {
  width: 32px;
  height: 32px;
}

body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 14px;
  left: 55px;
  width: 18px;
  height: 28px;
  border-radius: 4px;
  font-size: 20px;
}

body.sidebar-collapsed .side-nav,
body.sidebar-collapsed .sidebar-footer {
  gap: 2px;
  padding-inline: 10px;
}

body.sidebar-collapsed .nav-group {
  display: flex;
  justify-items: stretch;
}

body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-subtoggle,
body.sidebar-collapsed .nav-single,
body.sidebar-collapsed .sidebar-config {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  margin: 2px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #aebdc8;
  padding: 0 9px;
  text-indent: 0;
}

body.sidebar-collapsed .nav-title:hover,
body.sidebar-collapsed .nav-link:hover,
body.sidebar-collapsed .nav-subtoggle:hover,
body.sidebar-collapsed .nav-single:hover,
body.sidebar-collapsed .sidebar-config:hover {
  border: 0;
  background: #1a303b;
  color: #fff;
  transform: none;
}

body.sidebar-collapsed .nav-title.active,
body.sidebar-collapsed .nav-link.active,
body.sidebar-collapsed .nav-subtoggle.active,
body.sidebar-collapsed .nav-single.active,
body.sidebar-collapsed .sidebar-config.active {
  border: 0;
  background: #1c514d;
  box-shadow: inset 3px 0 0 #54c8b7;
}

body.sidebar-collapsed .collapsed-menu-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 6px;
  background: #1b3540;
  color: #bfe8e3;
}

body.sidebar-collapsed .nav-title.active .collapsed-menu-icon,
body.sidebar-collapsed .nav-link.active .collapsed-menu-icon,
body.sidebar-collapsed .sidebar-config.active .collapsed-menu-icon {
  background: var(--primary);
  color: #fff;
}

body.sidebar-collapsed .collapsed-menu-icon svg {
  width: 19px;
  height: 19px;
}

body.sidebar-collapsed .sidebar-context {
  display: none;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), rgba(23, 33, 43, 0.04)),
    var(--bg);
}

.login-shell {
  display: grid;
  width: min(100%, 520px);
}

.login-card {
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
}

.login-brand h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-profile-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-profile-intro strong {
  color: var(--text);
}

.login-profile-options {
  display: grid;
  gap: 10px;
}

.login-profile-option {
  display: block;
  cursor: pointer;
}

.login-profile-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-profile-option-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-profile-option-card strong {
  color: var(--text);
  font-size: 16px;
}

.login-profile-option-card small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-profile-option input:checked + .login-profile-option-card {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.06);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.25);
}

.login-profile-option:hover .login-profile-option-card {
  border-color: rgba(15, 118, 110, 0.45);
}

.login-form .button.secondary.login-submit {
  text-align: center;
}

.painel-admin-body {
  min-height: 100vh;
  background: #f1f4f8;
}

.painel-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: #0f172a;
  color: #fff;
}

.painel-admin-brand {
  display: grid;
  gap: 2px;
}

.painel-admin-brand strong {
  font-size: 15px;
}

.painel-admin-brand span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.painel-admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.painel-admin-user {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin-right: 4px;
}

.painel-admin-shell {
  max-width: 1180px;
}

.app-shell {
  grid-area: main;
  width: 100%;
  margin: 0 auto;
  padding: 24px 18px 36px;
  overflow-x: clip;
}

.home-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0;
  background: #f1f4f8;
}

.home-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 32px; background: #fff; border-bottom: 1px solid #e1e5ea; }
.home-topbar-info { display: flex; align-items: center; gap: 13px; color: #68717b; font-size: 12px; }
.home-topbar-info strong { color: #252b31; font-size: 16px; }
.home-topbar-info i { width: 1px; height: 30px; margin: 0 8px; background: #d8dde2; }
.home-logo-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  place-items: center;
  width: 100%;
  padding: 8px 16px 12px;
  box-sizing: border-box;
}

.home-logo-panel img {
  display: block;
  max-width: min(250px, 34vw);
  width: 100%;
  height: auto;
}

.home-logo-panel--large img {
  max-width: min(720px, 72vw);
}

.home-shortcuts { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; width: min(620px, 86vw); margin-top: 10px; }
.home-shortcut { grid-column: span 2; display: flex; min-height: 86px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #d5dce5; border-radius: 14px; background: #fff; color: #17212b; box-shadow: 0 3px 7px rgba(25, 43, 58, .16); font-size: 14px; font-weight: 600; text-decoration: none; }
.home-shortcut:nth-child(1), .home-shortcut:nth-child(2) { grid-column: span 3; }
.home-shortcut:hover { border-color: #0b817b; transform: translateY(-1px); }
.home-shortcut-primary { background: #277ab3; border-color: #1f6597; color: #fff; }
.home-shortcut-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; }
.home-shortcut-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
@media (max-width: 680px) { .home-topbar { padding: 0 16px; } .home-topbar-info { gap: 6px; font-size: 10px; } .home-topbar-info strong { font-size: 12px; } .home-shortcuts { grid-template-columns: repeat(2, 1fr); } .home-shortcut, .home-shortcut:nth-child(1), .home-shortcut:nth-child(2) { grid-column: span 1; min-height: 110px; font-size: 15px; } }

.configuration-form {
  max-width: 1180px;
}

.configuration-form > .form-tabs {
  position: sticky;
  top: 0;
  z-index: 24;
}

.configuration-form > .tab-panel {
  border-top: 0;
}

.configuration-logo-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(260px, 1fr);
  gap: 20px;
  align-items: center;
}

.configuration-preview {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 18px;
}

.configuration-preview img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.configuration-file-field {
  grid-column: auto;
}

.configuration-api-grid .field {
  grid-column: span 4;
}

.configuration-api-grid .field.small {
  grid-column: span 2;
}

.configuration-api-grid .field.wide {
  grid-column: span 6;
}

.configuration-api-grid .field.full {
  grid-column: 1 / -1;
}

.configuration-api-grid textarea {
  min-height: 150px;
}

.configuration-section-spacing {
  margin-top: 28px;
}

.configuration-divider {
  height: 1px;
  margin: 28px 0 22px;
  background: var(--line);
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.configuration-consultation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: end;
}

.configuration-consultation-grid .full {
  grid-column: 1 / -1;
}

.configuration-consultation-grid textarea {
  min-height: 116px;
}

.configuration-check {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.configuration-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.configuration-provider-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 280px));
  gap: 12px;
  margin-bottom: 18px;
}

.configuration-radio-choice.compact {
  min-height: 58px;
}

.configuration-ai-panel {
  margin-top: 14px;
}

.configuration-ai-panel .field {
  grid-column: span 6;
}

.configuration-ai-panel .field.full {
  grid-column: 1 / -1;
}

.configuration-anamnese-help {
  margin: 10px 0 0;
  max-width: 100%;
  line-height: 1.45;
  white-space: normal;
}

.configuration-anamnese-provider-panel {
  margin: 0;
  padding: 0;
}

.configuration-anamnese-provider-panel[hidden] {
  display: none !important;
}

.configuration-module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.configuration-check.module {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.configuration-check.module:has(input:checked) {
  border-color: var(--primary);
  background: #eefaf8;
  box-shadow: 0 0 0 1px var(--primary);
}

.configuration-agenda-policy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  border: 0;
  padding: 0;
}

.configuration-agenda-policy legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.configuration-radio-choice {
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  cursor: pointer;
}

.configuration-radio-choice:has(input:checked) {
  border-color: var(--primary);
  background: #eefaf8;
  box-shadow: 0 0 0 1px var(--primary);
}

.configuration-radio-choice input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.configuration-radio-choice span {
  display: grid;
  gap: 4px;
}

.configuration-radio-choice strong {
  color: var(--ink);
}

.configuration-radio-choice small {
  color: var(--muted);
  line-height: 1.35;
}

.configuration-printer-format {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 1rem 0 1.25rem;
}

.configuration-printer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.configuration-printer-actions .form-help {
  margin: 0;
}

.configuration-agenda-fields-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 0.75rem;
}

.configuration-agenda-fields-panel {
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  padding: 0.9rem 1rem 1rem;
  background: #f8fbfe;
}

.configuration-agenda-fields-panel .section-heading {
  margin-bottom: 0.75rem;
}

.configuration-agenda-fields-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.configuration-agenda-fields-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.configuration-agenda-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d7e1ec;
  border-radius: 8px;
  background: #fff;
}

.configuration-agenda-field-item.is-enabled {
  border-color: #9eb8d4;
  background: #eef6ff;
}

.configuration-agenda-field-item .configuration-check {
  margin: 0;
  flex: 1;
}

.configuration-agenda-field-actions {
  display: inline-flex;
  gap: 0.3rem;
}

.configuration-agenda-field-actions .button.compact {
  min-width: 34px;
  padding: 0.25rem 0.45rem;
}

.agenda-observation-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-pix-dialog {
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  color: #1f2a37;
  box-shadow: 0 18px 55px rgba(19, 34, 49, 0.3);
}

.agenda-pix-dialog::backdrop {
  background: rgba(14, 28, 42, 0.45);
}

.agenda-pix-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  min-width: 0;
}

.agenda-pix-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
  flex: 0 0 auto;
}

.agenda-pix-header .eyebrow {
  margin: 0 0 4px;
}

.agenda-pix-header h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.agenda-pix-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
  flex: 1 1 auto;
}

.agenda-pix-timer-wrap {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: #edf8f7;
  color: #08706d;
  font-weight: 700;
  box-sizing: border-box;
}

.agenda-pix-timer-wrap span {
  font-size: 0.92rem;
}

.agenda-pix-timer-wrap strong {
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

.agenda-pix-status {
  margin: 0;
  text-align: center;
  color: #42566b;
  font-size: 0.95rem;
}

.agenda-pix-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid #d7e0e8;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
}

.agenda-pix-qr-wrap[hidden] {
  display: none !important;
}

.agenda-pix-qr-wrap img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.agenda-pix-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.agenda-pix-meta-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7fafc;
  box-sizing: border-box;
}

.agenda-pix-meta-row span {
  color: #64748b;
  font-size: 0.88rem;
  padding-top: 1px;
}

.agenda-pix-meta-row strong {
  min-width: 0;
  text-align: right;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.agenda-pix-copy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.agenda-pix-copy-field > span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agenda-pix-copy-field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 84px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  background: #fff;
  color: #243746;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  box-sizing: border-box;
}

.agenda-pix-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
  margin: 0;
  flex: 0 0 auto;
}

.agenda-pix-actions .button {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .agenda-pix-actions {
    grid-template-columns: 1fr;
  }

  .agenda-pix-meta-row {
    grid-template-columns: 1fr;
  }

  .agenda-pix-meta-row strong {
    text-align: left;
  }
}

.bank-integration-guide {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #d7e8f5;
  border-radius: 8px;
  background: #f3f9fd;
}

.bank-integration-guide ol {
  margin: 8px 0 0;
  padding-left: 18px;
}

.bank-integration-guide li {
  margin: 4px 0;
  line-height: 1.4;
}

.bank-integration-guide code {
  font-size: 12px;
}

.bank-receipt-selector {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bank-receipt-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.bank-receipt-select-field {
  flex: 1 1 320px;
  min-width: 240px;
}

.bank-receipt-current {
  margin: 12px 0 0;
  color: var(--muted);
}

.bank-receipt-current strong {
  color: var(--text);
}

.bank-integration-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.bank-integration-list {
  display: grid;
  gap: 10px;
}

.bank-integration-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.bank-integration-card:hover {
  border-color: var(--line-strong);
}

.bank-integration-card.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.bank-integration-card strong {
  font-size: 15px;
}

.bank-integration-type {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.bank-integration-new {
  border-style: dashed;
}

.bank-integration-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bank-integration-actions {
  margin-top: 18px;
  justify-content: flex-start;
}

.status-pill.ativo {
  background: #e7f7ef;
  color: #0f7a45;
}

.status-pill.configurado {
  background: #eef5ff;
  color: #1d4f91;
}

.status-pill.pendente {
  background: #f4f6f8;
  color: #5b6b7c;
}

@media (max-width: 900px) {
  .bank-integration-layout {
    grid-template-columns: 1fr;
  }
}

.agenda-out-of-hours-shell {
  display: grid;
  min-height: calc(100vh - 100px);
  place-items: center;
}

.agenda-out-of-hours-card {
  width: min(620px, 100%);
  border-top: 4px solid #d97706;
}

.agenda-out-of-hours-card h2 {
  margin: 0 0 10px;
}

.agenda-out-of-hours-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.agenda-out-of-hours-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.agenda-out-of-hours-detail {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.agenda-out-of-hours-detail span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.agenda-out-of-hours-detail strong {
  overflow-wrap: anywhere;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.permission-group {
  display: grid;
  gap: 8px;
  align-content: start;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.permission-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 32px;
  color: var(--text);
  font-weight: 700;
}

.permission-choice input {
  width: 16px;
  height: 16px;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -18px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 246, 0.96);
  padding: 24px 18px 14px;
  backdrop-filter: blur(10px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status-pill {
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  padding: 8px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.alert {
  border-radius: 8px;
  padding: 11px 13px;
  font-weight: 700;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.client-form,
.recent,
.search-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.employee-access-grid {
  align-items: end;
  margin-bottom: 18px;
}

.employee-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft, #f8fafc);
}

.employee-profiles-grid .permission-choice {
  margin: 0;
}

.employee-change-professional {
  grid-column: span 5;
  min-height: 42px;
  align-self: end;
}

.employee-profile-permission-panels {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.employee-profile-permission-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.employee-profile-permission-panel.is-hidden {
  display: none;
}

.employee-profile-permission-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.employee-profile-permission-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.employee-profile-permission-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.employee-profile-access-total {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(14, 116, 144, 0.08);
  color: #0f172a;
  font-weight: 700;
}

.employee-field-disabled {
  opacity: 0.5;
}

.employee-permission-grid {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px 12px;
}

.form-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  text-transform: uppercase;
}

.form-tab:hover {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

.form-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-heading,
.recent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2,
.recent-heading h2 {
  font-size: 16px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.agenda-consulta-heading {
  gap: 12px;
}

.agenda-consulta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.agenda-status-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.agenda-status-row .status-select-field {
  width: min(320px, 100%);
}

.agenda-subscription-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  max-width: min(560px, 100%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  color: #1f3b2c;
  font-size: 0.92rem;
  line-height: 1.2;
}

.agenda-subscription-badge.is-empty,
.agenda-subscription-badge[hidden] {
  display: none;
}

.agenda-subscription-badge.is-current {
  border-color: #9ec5ae;
  background: #eef7f1;
  color: #1f4d32;
}

.agenda-subscription-badge.is-overdue {
  border-color: #e2a8a8;
  background: #fdf1f1;
  color: #7a1f1f;
}

.agenda-subscription-summary {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.agenda-subscription-plan {
  font-weight: 700;
}

.agenda-subscription-sep {
  opacity: 0.55;
}

.agenda-subscription-due {
  font-weight: 600;
}

.agenda-subscription-overdue-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
  width: 100%;
  font-size: 0.86rem;
}

.agenda-subscription-overdue-list li {
  margin: 0;
}

.agenda-treatment-section {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.agenda-treatment-entry {
  align-items: end;
}

.agenda-client-packages {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.agenda-client-packages.is-empty,
.agenda-client-packages[hidden] {
  display: none;
}

.agenda-client-package-card {
  border: 1px solid #9ec5ae;
  border-radius: 8px;
  background: #eef7f1;
  padding: 8px 10px;
}

.agenda-client-package-title {
  font-weight: 700;
  color: #1f4d32;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.agenda-package-items-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}

.agenda-package-items-table th,
.agenda-package-items-table td {
  padding: 2px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.84rem;
  line-height: 1.2;
  vertical-align: middle;
  height: 28px;
}

.agenda-package-items-table th {
  background: #f4faf6;
  font-weight: 600;
  height: 26px;
}

.agenda-package-items-table th:nth-child(3),
.agenda-package-items-table td:nth-child(3),
.agenda-package-items-table th:nth-child(4),
.agenda-package-items-table td:nth-child(4),
.agenda-package-items-table th:nth-child(5),
.agenda-package-items-table td:nth-child(5),
.agenda-package-items-table th:nth-child(6),
.agenda-package-items-table td:nth-child(6) {
  width: 64px;
  text-align: center;
}

.agenda-package-check-col {
  width: 32px;
  text-align: center;
}

.agenda-package-add-qty {
  width: 52px;
  height: 24px;
  min-height: 24px;
  padding: 0 4px;
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.1;
}

.agenda-package-items-table .button.compact {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 0.8rem;
  line-height: 1.1;
}

.agenda-package-items-table tr.is-exhausted {
  opacity: 0.55;
}

.agenda-package-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.agenda-package-card-actions .button.compact {
  min-height: 26px;
  padding: 3px 10px;
  font-size: 0.82rem;
}

.agenda-treatment-select-field {
  grid-column: span 6;
}

.agenda-treatment-qty-field {
  grid-column: span 1;
}

.agenda-treatment-value-field {
  grid-column: span 2;
}

.agenda-treatment-add-actions {
  grid-column: span 3;
  justify-content: flex-start;
  align-items: end;
}

.agenda-treatment-table-wrap {
  margin-top: 14px;
}

.agenda-treatment-table th:first-child,
.agenda-treatment-table td:first-child {
  width: 90px;
}

.agenda-treatment-table th:nth-child(3),
.agenda-treatment-table td:nth-child(3) {
  width: 70px;
}

.agenda-treatment-table th:nth-child(4),
.agenda-treatment-table td:nth-child(4),
.agenda-treatment-table th:nth-child(5),
.agenda-treatment-table td:nth-child(5) {
  width: 140px;
}

.agenda-treatment-table th:last-child,
.agenda-treatment-table td:last-child {
  width: 100px;
}

.agenda-treatment-total-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.agenda-treatment-total-row .field {
  width: min(220px, 100%);
}

.agenda-treatment-total-row .agenda-treatment-total-field {
  width: min(360px, 100%);
}

.agenda-treatment-total-row.has-discount .agenda-treatment-total-field {
  width: min(300px, 100%);
}

.agenda-treatment-discount-percent-field input,
.agenda-treatment-discount-value-field input {
  background: #f8fafc;
}

.field {
  display: flex;
  min-width: 0;
  grid-column: span 3;
  flex-direction: column;
  gap: 6px;
}

.field.small {
  grid-column: span 2;
}

.field.wide {
  grid-column: span 5;
}

.patient-schedule-code {
  grid-column: span 2;
}

.patient-schedule-select {
  grid-column: span 6;
}

.patient-schedule-patient-actions {
  display: flex;
  grid-column: span 4;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
}

.patient-schedule-name {
  grid-column: span 4;
}

.patient-schedule-cpf {
  grid-column: span 2;
}

.patient-schedule-cellphone {
  grid-column: span 3;
}

.patient-schedule-actions {
  display: flex;
  grid-column: span 3;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.patient-schedule-patient-actions .button,
.patient-schedule-actions .button {
  min-width: 0;
  white-space: nowrap;
}

.patient-schedule-results {
  margin-top: 16px;
}

.patient-schedule-row-actions {
  display: flex;
  gap: 8px;
}

.patient-schedule-results tr.schedule-current-or-future {
  background: #e8f8ef;
}

.patient-schedule-results tr.schedule-current-or-future:hover {
  background: #d8f2e3;
}

.patient-schedule-results tr.schedule-current-or-future td {
  color: #0f6b3d;
}

.patient-schedule-observation {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field.status-select-field {
  grid-column: span 4;
}

.field.agenda-code-field {
  grid-column: span 3;
}

.field.agenda-name-field {
  grid-column: span 9;
}

.field.agenda-contact-field,
.field.agenda-profession-field {
  grid-column: span 4;
}

.field.agenda-lookup-field {
  grid-column: span 6;
}

.field.full {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.status-option {
  --status-color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--status-color) 38%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--status-color) 9%, #fff);
  color: var(--status-color);
  padding: 7px 12px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.status-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-option:hover,
.status-option.selected,
.status-option:has(input:checked) {
  background: color-mix(in srgb, var(--status-color) 17%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 16%, transparent);
  transform: translateY(-1px);
}

.status-select-wrap {
  --status-color: var(--muted);
  position: relative;
  display: flex;
  align-items: center;
}

.status-select-wrap .status-color-dot {
  position: absolute;
  left: 12px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--status-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 18%, transparent);
}

.status-select-wrap .status-select {
  border-color: color-mix(in srgb, var(--status-color) 45%, var(--line-strong));
  color: var(--status-color);
  font-weight: 800;
  padding-left: 32px;
}

.status-select-wrap .status-select:focus {
  border-color: var(--status-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 18%, transparent);
}

.status-agendado {
  --status-color: #111827;
}

.status-confirmado {
  --status-color: #0000ff;
}

.status-faltou {
  --status-color: #ff0000;
}

.status-aguardando {
  --status-color: #008000;
}

.status-consultando {
  --status-color: #800020;
}

.status-concluido {
  --status-color: #6b7280;
}

.status-bloqueado {
  --status-color: #ff0000;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input,
select {
  height: 42px;
  padding: 8px 11px;
}

textarea {
  min-height: 132px;
  padding: 10px 11px;
  resize: vertical;
}

input:disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

input.paid-value-input:disabled {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
  outline: none;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lookup-control {
  display: grid;
  grid-template-columns: minmax(86px, 0.35fr) minmax(180px, 1fr);
  gap: 8px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface-soft);
}

.actions-inline {
  align-self: end;
  display: flex;
  gap: 10px;
}

.client-search-code {
  grid-column: span 2;
}

.client-search-name {
  grid-column: span 5;
}

.client-search-cpf {
  grid-column: span 3;
}

.client-search-cellphone {
  grid-column: span 3;
}

.client-search-city {
  grid-column: span 4;
}

.client-search-actions {
  display: flex;
  grid-column: span 5;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.client-search-actions .button {
  min-width: 0;
  white-space: nowrap;
}

.treatment-search-grid {
  align-items: end;
  column-gap: 20px;
  padding: 18px 18px 18px 28px;
}

.treatment-search-grid .field.small {
  grid-column: span 2;
}

.treatment-search-grid .field.wide {
  grid-column: span 6;
}

.treatment-search-actions {
  grid-column: span 4;
  justify-content: flex-start;
}

.agreement-search-grid {
  align-items: end;
  column-gap: 14px;
  padding: 18px;
}

.agreement-search-code {
  grid-column: span 2;
}

.agreement-search-name {
  grid-column: span 6;
}

.agreement-search-actions {
  grid-column: span 4;
  align-items: flex-end;
  justify-content: flex-start;
}

.agreement-search-actions .button {
  min-width: 130px;
}

.compact-money-input {
  min-height: 34px;
  padding: 7px 9px;
}

.compact-select {
  min-height: 34px;
  padding: 7px 9px;
}

.branch-search-grid {
  align-items: end;
  column-gap: 14px;
  padding: 18px;
}

.branch-search-code {
  grid-column: span 2;
}

.branch-search-name {
  grid-column: span 5;
}

.branch-search-cnpj {
  grid-column: span 2;
}

.branch-search-actions {
  grid-column: span 3;
  align-items: flex-end;
  justify-content: flex-start;
}

.branch-search-actions .button {
  min-width: 120px;
}

.textarea-field {
  grid-column: 1 / -1;
}

.checkbox-field {
  justify-content: flex-end;
}

.checkbox-control {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font-weight: 800;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
}

.checkbox-card {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font-weight: 800;
}

.checkbox-card input {
  width: 18px;
  height: 18px;
}

.professional-medico-checkbox {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  align-self: end;
  gap: 8px;
  font-weight: 800;
}

.professional-medico-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.treatment-link-filter-grid {
  align-items: end;
  padding: 18px;
}

.treatment-link-select {
  grid-column: span 4;
}

.treatment-link-actions {
  grid-column: span 4;
  align-items: flex-end;
  justify-content: flex-start;
}

.treatment-link-actions .button {
  min-width: 118px;
}

.treatment-link-table th:first-child,
.treatment-link-table td:first-child {
  width: 90px;
  text-align: center;
}

.treatment-link-list-filter {
  align-items: end;
  border-top: 1px solid var(--line);
  padding: 16px 18px 8px;
}

.treatment-link-search-field {
  grid-column: span 8;
}

.treatment-link-status-field {
  grid-column: span 4;
}

.check-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-cell input {
  width: 18px;
  height: 18px;
}

.treatment-link-empty {
  padding: 22px;
}

.professional-treatment-table-wrap {
  max-height: 460px;
  overflow: auto;
}

.professional-treatment-table-wrap thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-soft);
}

.professional-treatment-table-wrap table {
  min-width: 1080px;
}

.professional-treatment-value,
.professional-treatment-transfer-value {
  width: 132px;
}

.professional-treatment-transfer-type {
  min-width: 140px;
}

.professional-treatment-table-wrap input:disabled,
.professional-treatment-table-wrap select:disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
}

.payment-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(180px, 0.35fr);
  align-items: start;
  gap: 16px;
}

.payment-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.18fr) minmax(90px, 0.18fr);
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.payment-summary div {
  display: grid;
  gap: 4px;
}

.payment-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.payment-methods legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  font-weight: 800;
}

.payment-option input {
  grid-column: 2;
  justify-self: center;
}

.payment-option span {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}

.payment-value-field {
  align-self: start;
}

.payment-value-field input {
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}

.payment-observation-field {
  grid-column: 1 / -1;
}

.multi-payment-grid {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.28fr);
}

.multi-payment-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.multi-payment-methods legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-amount-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.payment-amount-card span,
.payment-total-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-amount-card input {
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.payment-total-card {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 86px;
  border: 1px solid rgba(13, 126, 119, 0.26);
  border-radius: 8px;
  background: #ecfdf5;
  padding: 14px;
}

.payment-side-panel {
  display: grid;
  gap: 12px;
}

.payment-due-card {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
}

.payment-discount-card {
  border-color: rgba(15, 118, 110, 0.28);
  background: #f0fdfa;
}

.payment-discount-card strong {
  color: #0f766e;
}

.payment-summary .payment-plan-info strong {
  color: #0f766e;
}

.payment-total-card strong {
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
  text-align: right;
}

.payment-due-card strong {
  color: #1d4ed8;
}

.payment-total-card.payment-total-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.payment-total-card.payment-total-error strong {
  color: #dc2626;
}

.payment-card-details {
  grid-column: 1 / -1;
}

.package-payment-total-card {
  min-height: 0;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) repeat(4, minmax(92px, 1fr));
  gap: 10px;
  align-items: end;
}

.schedule-head {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 0 6px;
  text-transform: uppercase;
}

.schedule-day {
  align-self: center;
  color: var(--text);
  font-weight: 900;
}

.schedule-field {
  grid-column: auto;
}

.schedule-field input {
  border-style: dashed;
  background: #f1f5f9;
  color: var(--muted);
}

.schedule-field input:not(:placeholder-shown) {
  border-style: solid;
  border-color: #5eb8a9;
  background: #ecfdf5;
  color: var(--text);
  font-weight: 800;
}

.schedule-field input:focus {
  border-style: solid;
}

.schedule-field span {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  color: inherit;
  font-family: var(--font-sans);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover {
  background: #f8fafc;
}

.button.active-filter {
  border-color: var(--primary);
  background: #ccfbf1;
  color: var(--primary-dark);
}

.button.danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.button.danger:hover {
  border-color: #fca5a5;
  background: #fecaca;
}

.button.whatsapp {
  background: #22c55e;
  color: #fff;
}

.button.whatsapp:hover {
  background: #16a34a;
}

.button.compact {
  min-height: 42px;
  padding: 8px 12px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button.disabled-button,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.recent {
  margin-top: 18px;
  padding: 18px;
}

.search-results {
  box-shadow: none;
}

.result-count {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.table-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.table-action:hover {
  border-color: var(--primary);
  background: #ecfdf5;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.pagination-link.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pagination-link.disabled {
  color: var(--muted);
  opacity: 0.55;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.placeholder-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.placeholder-panel h2 {
  margin-bottom: 8px;
}

.placeholder-panel p {
  margin: 0;
  color: var(--muted);
}

.agenda-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-family: var(--font-sans);
  overflow: hidden;
}

.agenda-sticky-panel {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -24px -18px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 246, 0.98);
  backdrop-filter: blur(10px);
  font-family: var(--font-sans);
}

.agenda-panel,
.agenda-sticky-panel,
.agenda-filter,
.agenda-table,
.agenda-table th,
.agenda-table td,
.agenda-table a,
.agenda-table button,
.agenda-table input,
.agenda-table select,
.weekly-table,
.weekly-table th,
.weekly-table td,
.weekly-table a,
.weekly-table button,
.weekly-table input,
.weekly-table select {
  font-family: var(--font-sans);
}

.agenda-sticky-panel .page-header {
  position: static;
  margin: 0;
  padding: 14px 18px 10px;
  box-shadow: none;
}

.agenda-sticky-panel .page-header h1 {
  font-size: 24px;
  line-height: 1.2;
}

.agenda-availability-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}

.agenda-availability-summary .weekly-availability-legend {
  justify-content: flex-end;
}

.agenda-availability-summary .agenda-occupancy {
  margin-left: 0;
}

.agenda-panel.agenda-panel-flat {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.agenda-panel.agenda-panel-flat .agenda-heading {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.agenda-panel.agenda-panel-flat .agenda-table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.agenda-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  padding: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  background: #f8fafc;
  padding: 5px 8px;
  white-space: nowrap;
}

.legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.legend-agendado {
  color: #111827;
}

.legend-aguardando {
  color: #008a22;
}

.legend-confirmado {
  color: #1d4ed8;
}

.legend-consultando {
  color: #8a008a;
}

.legend-concluido {
  color: #7c8491;
}

.legend-bloqueado,
.legend-faltou {
  color: #dc2626;
}

.agenda-filter {
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.agenda-filter .form-section {
  background: #fff;
  padding: 14px 18px;
}

.agenda-filter .form-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.agenda-filter.weekly-filter .form-grid {
  flex-wrap: nowrap;
  align-items: end;
  overflow: visible;
}

.agenda-filter.weekly-filter .agenda-date-field,
.agenda-filter.weekly-filter .agenda-professional-field {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  overflow: visible;
}

.agenda-filter.weekly-filter .agenda-date-field {
  position: relative;
  z-index: 40;
}

.agenda-filter.weekly-filter .agenda-professional-field {
  width: min(220px, 28vw);
}

.agenda-filter.weekly-filter .agenda-inline-actions {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  width: auto;
  min-width: 0;
  align-items: end;
  overflow: visible;
}

.agenda-filter.weekly-filter .agenda-more-menu {
  flex: 0 0 auto;
}

.agenda-filter.weekly-filter .agenda-more-panel {
  left: 0;
  right: auto;
}

.agenda-filter.weekly-filter .weekly-toolbar-meta {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: auto;
  justify-content: flex-end;
}

.agenda-filter.weekly-filter .weekly-toolbar-meta .weekly-availability-legend {
  flex-wrap: nowrap;
}

.weekly-week-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  flex: 0 0 auto;
  align-self: end;
  height: 42px;
  max-height: 42px;
  box-sizing: border-box;
}

.agenda-inline-actions .weekly-week-nav .weekly-week-nav-button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 20px;
  max-height: 20px;
  padding: 0 8px;
  font-size: 10px;
  line-height: 1;
  align-self: stretch;
  box-sizing: border-box;
}

.agenda-filter .field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.agenda-filter .field > span {
  line-height: 1;
}

.agenda-filter .agenda-professional-field select {
  min-height: 42px;
  box-sizing: border-box;
}

.agenda-date-field {
  grid-column: auto;
  width: 148px;
  flex: 0 0 auto;
  max-width: 100%;
}

.agenda-professional-field {
  grid-column: auto;
  width: min(240px, 100%);
  flex: 0 0 auto;
}

.agenda-date-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.agenda-date-caption {
  color: inherit;
  font: inherit;
  text-transform: uppercase;
}

.agenda-weekday {
  display: inline-flex;
  align-items: center;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}

.agenda-date-with-weekday {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 42px;
}

.agenda-date-with-weekday .agenda-calendar,
.agenda-date-field .agenda-calendar {
  width: 100%;
  flex: 1 1 auto;
}

.agenda-calendar {
  position: relative;
}

.agenda-calendar-trigger {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 9px 12px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.agenda-calendar-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.agenda-calendar-icon {
  position: relative;
  width: 16px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.agenda-calendar-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  border-top: 2px solid currentColor;
}

.agenda-calendar-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  left: 0;
  width: min(340px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.agenda-calendar-toolbar {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.agenda-calendar-toolbar strong {
  text-align: center;
}

.agenda-calendar-nav {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.agenda-calendar-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.agenda-calendar-weekdays,
.agenda-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.agenda-calendar-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.agenda-calendar-day,
.agenda-calendar-spacer {
  aspect-ratio: 1;
}

.agenda-calendar-day {
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f3f5f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.agenda-calendar-day.professional-attendance-day {
  border-color: #94d6ad;
  background: #dcf5e5;
  color: #126631;
}

.agenda-calendar-day:hover {
  border-color: var(--primary);
}

.agenda-calendar-day.today {
  box-shadow: inset 0 0 0 1px #2563eb;
}

.agenda-calendar-day.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.agenda-calendar-today {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.agenda-calendar-today:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.agenda-calendar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.agenda-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.agenda-calendar-legend i {
  width: 9px;
  height: 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f3f5f7;
}

.agenda-calendar-legend i.available {
  border-color: #94d6ad;
  background: #dcf5e5;
}

@media (max-width: 620px) {
  .agenda-calendar-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    transform: translate(-50%, -50%);
  }
}

.agenda-inline-actions {
  display: flex;
  grid-column: auto;
  flex: 1 1 auto;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  align-self: end;
}

.agenda-inline-actions .button {
  align-self: flex-end;
  min-height: 42px;
  box-sizing: border-box;
  white-space: nowrap;
}

.agenda-more-menu {
  position: relative;
  display: inline-flex;
  align-self: flex-end;
  z-index: 50;
}

.agenda-more-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  display: none;
  min-width: 188px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.agenda-more-panel:not([hidden]) {
  display: grid;
}

.agenda-more-panel[hidden] {
  display: none !important;
}

.agenda-more-option {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.agenda-more-option:hover,
.agenda-more-option.is-active {
  background: #ecfeff;
  color: var(--primary-dark);
  text-decoration: none;
}

.agenda-occupancy {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  align-self: flex-end;
  gap: 4px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 4px 5px;
  white-space: nowrap;
}

.agenda-occupancy-all {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  border: 1px solid #c9d5e3;
  border-radius: 5px;
  background: #eef3f8;
  color: #334155;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.agenda-occupancy-all:hover,
.agenda-occupancy-all.is-active {
  border-color: #94a3b8;
  background: #e2e8f0;
  box-shadow: 0 0 0 2px rgba(51, 65, 85, 0.12);
}

.agenda-occupancy-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.agenda-occupancy-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.agenda-occupancy-percent {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.agenda-occupancy-item strong {
  font-size: 10px;
}

.agenda-occupancy-item small {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.agenda-occupancy-count {
  font-size: 13px;
  font-weight: 900;
  text-transform: lowercase;
}

.agenda-occupancy-item.free {
  background: #dcfce7;
  color: #166534;
}

.agenda-occupancy-item.occupied {
  background: #fee2e2;
  color: #991b1b;
}

a.agenda-occupancy-item {
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

a.agenda-occupancy-item:hover {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

a.agenda-occupancy-item.free:hover,
a.agenda-occupancy-item.free.is-active {
  border-color: #86efac;
  box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.18);
}

a.agenda-occupancy-item.occupied:hover,
a.agenda-occupancy-item.occupied.is-active {
  border-color: #fca5a5;
  box-shadow: 0 0 0 2px rgba(153, 27, 27, 0.18);
}

a.agenda-occupancy-item.is-active {
  transform: translateY(-1px);
}

.agenda-move-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.agenda-move-table .move-target-slot td {
  cursor: pointer;
}

.agenda-move-table .move-slot-button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.agenda-move-table .move-slot-static {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: inherit;
  font-weight: 900;
}

.agenda-move-table .move-source-slot td {
  background: #fff7ed;
}

.agenda-move-table .move-source-slot .time-cell {
  background: #ffedd5;
}

.agenda-move-table .move-target-slot:hover td,
.agenda-move-table .move-target-slot:hover .time-cell {
  background: #dcfce7;
}

.agenda-move-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.agenda-move-badge.source {
  background: #ffedd5;
  color: #9a3412;
}

.agenda-move-badge.free {
  background: #dcfce7;
  color: #166534;
}

.agenda-heading {
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.agenda-table-wrap {
  overflow-x: auto;
}

.agenda-table {
  min-width: 1280px;
}

.agenda-table th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.agenda-floating-header {
  position: fixed;
  z-index: 29;
  display: none;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.agenda-floating-header.visible {
  display: block;
}

.agenda-floating-header .agenda-table {
  margin: 0;
}

.agenda-floating-header .agenda-table th {
  position: static;
}

.agenda-floating-header .weekly-table {
  margin: 0;
}

.agenda-floating-header .weekly-table thead th {
  position: static;
}

.agenda-table td {
  padding: 11px 12px;
  vertical-align: middle;
}

.agenda-table.agenda-table-compact th {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 10px;
}

.agenda-table.agenda-table-compact td {
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 12px;
  line-height: 1.15;
}

.agenda-table.agenda-table-compact .time-cell-actions,
.agenda-table.agenda-table-compact .time-link {
  min-height: 26px;
}

.agenda-table.agenda-table-compact .add-slot-link {
  min-height: 0;
}

.agenda-table.agenda-table-compact .time-link {
  padding-top: 3px;
  padding-bottom: 3px;
}

.agenda-payment-cell {
  text-align: center;
}

.agenda-paid-icon {
  display: inline-flex;
  width: 26px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: #16a34a;
  font-family: Arial, sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    1px 0 0 #0f6f31,
    0 1px 0 #0f6f31,
    1px 2px 2px rgba(15, 111, 49, 0.28);
}

.agenda-table .time-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 72px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.agenda-list-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.agenda-list-table tbody tr:nth-child(even) td {
  background: #f1f5f9;
}

.agenda-list-table tbody tr:nth-child(odd) .time-cell {
  background: #fff;
}

.agenda-list-table tbody tr:nth-child(even) .time-cell {
  background: #f1f5f9;
}

.time-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 32px;
  border-radius: 4px;
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: none;
}

.time-link:hover {
  background: #ccfbf1;
  text-decoration: none;
}

.time-link-value {
  min-width: 3.2em;
  font-variant-numeric: tabular-nums;
}

.observation-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

.observation-dot.is-empty {
  background: transparent;
  box-shadow: none;
}

.time-cell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.add-slot-slot {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  min-height: 22px;
}

.agenda-table.agenda-encaixe-mode .add-slot-slot {
  display: inline-flex;
}

.add-slot-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  padding: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.add-slot-link:hover {
  border-color: var(--primary);
  background: #ccfbf1;
  color: var(--primary-dark);
  text-decoration: none;
}

.agenda-table .filled-slot td {
  background: #f0fdfa;
}

.agenda-table .filled-slot .time-cell {
  background: #ccfbf1;
}

.agenda-table .blocked-slot td {
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 800;
}

.agenda-table .blocked-slot .time-cell {
  background: #ef4444;
}

.agenda-table .blocked-slot .time-link {
  color: #ffffff;
}

.agenda-list-table tbody tr:hover td {
  background: #f8fafc;
}

.agenda-list-table tbody tr:hover .time-cell {
  background: #e6fffb;
}

.agenda-list-table .empty-slot td {
  color: #94a3b8;
}

.agenda-list-table .empty-slot .time-cell {
  color: var(--primary-dark);
}

.agenda-list-table tbody tr.available-slot-row:nth-child(odd) td,
.agenda-list-table tbody tr.available-slot-row:nth-child(odd) .time-cell {
  background: #ecfdf5;
}

.agenda-list-table tbody tr.available-slot-row:nth-child(even) td,
.agenda-list-table tbody tr.available-slot-row:nth-child(even) .time-cell {
  background: #dcfce7;
}

.agenda-list-table tbody tr.unavailable-slot-row:nth-child(odd) td,
.agenda-list-table tbody tr.unavailable-slot-row:nth-child(odd) .time-cell {
  background: #f8fafc;
}

.agenda-list-table tbody tr.unavailable-slot-row:nth-child(even) td,
.agenda-list-table tbody tr.unavailable-slot-row:nth-child(even) .time-cell {
  background: #e2e8f0;
}

.agenda-list-table tbody tr.available-slot-row:hover td,
.agenda-list-table tbody tr.available-slot-row:hover .time-cell {
  background: #d1fae5;
}

.agenda-list-table tbody tr.unavailable-slot-row:hover td,
.agenda-list-table tbody tr.unavailable-slot-row:hover .time-cell {
  background: #dbe3ec;
}

.agenda-list-table .situation-2 td,
.agenda-list-table .situation-2 .time-link {
  color: #0000ff;
}

.agenda-list-table .situation-3 td,
.agenda-list-table .situation-3 .time-link {
  color: #ff0000;
}

.agenda-list-table .situation-4 td,
.agenda-list-table .situation-4 .time-link {
  color: #008000;
}

.agenda-list-table .situation-5 td,
.agenda-list-table .situation-5 .time-link {
  color: #800020;
}

.agenda-list-table .situation-6 td,
.agenda-list-table .situation-6 .time-link {
  color: #6b7280;
}

.agenda-list-table .situation-7 td,
.agenda-list-table .situation-7 .time-link {
  color: #ff0000;
}

.weekly-panel {
  overflow: hidden;
}

.weekly-availability-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.weekly-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
  min-height: 42px;
  min-width: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  text-align: right;
}

.weekly-toolbar-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.weekly-toolbar-meta .weekly-availability-legend {
  flex-wrap: wrap;
}

.weekly-toolbar-meta .result-count {
  align-self: center;
}

.weekly-availability-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.weekly-availability-item::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}

.weekly-availability-item.available::before {
  border-color: #5eb8a9;
  background: #ecfdf5;
}

.weekly-availability-item.unavailable::before {
  border-style: dashed;
  background: #f1f5f9;
}

.weekly-table-wrap {
  overflow: auto;
}

.weekly-table {
  min-width: 1180px;
  table-layout: fixed;
}

.weekly-table th,
.weekly-table td {
  border: 1px solid var(--line);
  white-space: normal;
  padding: 3px 5px;
}

.weekly-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  color: var(--text);
  text-transform: none;
}

.weekly-table thead th span,
.weekly-table thead th strong {
  display: block;
}

.weekly-table thead th span {
  color: var(--muted);
  font-size: 12px;
}

.weekly-table thead th strong {
  margin-top: 3px;
  font-size: 14px;
}

.weekly-day-link {
  display: block;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.weekly-day-link:hover {
  background: #e8f5f3;
  color: var(--primary);
}

.weekly-time-head,
.weekly-time-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 72px;
  background: #fff;
  color: var(--primary-dark);
  text-align: center;
}

.weekly-time-cell {
  font-weight: 900;
}

.weekly-table .today-column {
  background: #e0f2fe;
}

.weekly-slot-link {
  display: grid;
  min-height: 28px;
  gap: 0;
  align-content: center;
  color: inherit;
  text-decoration: none;
}

.weekly-slot-link:hover {
  text-decoration: none;
}

.weekly-slot-meta,
.weekly-slot-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.weekly-slot-time {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.weekly-slot-link strong {
  font-size: 13px;
}

.weekly-patient-name {
  font-size: 12px;
  line-height: 1.15;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.weekly-patient-code {
  flex: 0 0 auto;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}

.weekly-slot-link span,
.weekly-slot-link small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.weekly-slot-link small {
  white-space: nowrap;
}

.free-slot {
  background: #f0fdf4;
  color: #16a34a;
}

.weekly-table .available-slot {
  border-color: #b7ded6;
  background: #ecfdf5;
}

.weekly-table .unavailable-slot {
  border-color: #d9e1ea;
  background: #f1f5f9;
}

.weekly-table .unavailable-slot .weekly-slot-link {
  opacity: 0.56;
}

.agenda-professionals-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.agenda-professionals-legend-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 12px;
  font-weight: 700;
}

.agenda-professionals-legend-item.tone-empty {
  background: #fecaca;
  border-color: #dc2626;
  color: #7f1d1d;
}

.agenda-professionals-legend-item.tone-low {
  background: #fed7aa;
  border-color: #ea580c;
  color: #7c2d12;
}

.agenda-professionals-legend-item.tone-mid {
  background: #fde047;
  border-color: #ca8a04;
  color: #713f12;
}

.agenda-professionals-legend-item.tone-high {
  background: #86efac;
  border-color: #16a34a;
  color: #14532d;
}

.agenda-professionals-legend-item.tone-full {
  background: #22c55e;
  border-color: #15803d;
  color: #052e16;
}

.agenda-professionals-table {
  min-width: 980px;
}

.agenda-professionals-by-day th,
.agenda-professionals-by-day td {
  width: 14.28%;
  vertical-align: top;
}

.agenda-professionals-day-stack {
  padding: 0.55rem;
  background: #f8fbfe;
}

.agenda-professionals-stack {
  display: grid;
  gap: 0.45rem;
}

.agenda-professionals-card {
  --fill-percent: 0%;
  --fill-color: #dc2626;
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 3px solid #d7e1ec;
  border-radius: 8px;
  background: #ffffff;
  text-decoration: none;
  color: #1f2a37;
  min-height: 64px;
}

.agenda-professionals-card.tone-empty {
  --fill-color: #ef4444;
  border-color: #dc2626;
}

.agenda-professionals-card.tone-low {
  --fill-color: #f97316;
  border-color: #ea580c;
}

.agenda-professionals-card.tone-mid {
  --fill-color: #eab308;
  border-color: #ca8a04;
}

.agenda-professionals-card.tone-high {
  --fill-color: #4ade80;
  border-color: #16a34a;
}

.agenda-professionals-card.tone-full {
  --fill-color: #16a34a;
  border-color: #15803d;
}

.agenda-professionals-card-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill-percent);
  max-width: 100%;
  background: var(--fill-color);
  opacity: 0.72;
  pointer-events: none;
}

.agenda-professionals-card-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  min-height: 64px;
}

.agenda-professionals-card:hover {
  filter: brightness(0.98);
  box-shadow: 0 1px 0 rgba(15, 38, 62, 0.08);
}

.agenda-professionals-card-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.agenda-professionals-card-specialty {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  line-height: 1.2;
}

.agenda-professionals-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.agenda-professionals-card-meta strong {
  font-size: 14px;
}

.agenda-professionals-card-meta small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}

.agenda-professionals-empty-day {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 0.75rem 0.4rem;
}

.occupied-slot {
  background: #fff;
}

.weekly-table tbody tr:nth-child(odd) .weekly-time-cell,
.weekly-table tbody tr:nth-child(odd) .occupied-slot:not(.available-slot):not(.unavailable-slot) {
  background: #fff;
}

.weekly-table tbody tr:nth-child(even) .weekly-time-cell,
.weekly-table tbody tr:nth-child(even) .occupied-slot:not(.available-slot):not(.unavailable-slot) {
  background: #f1f5f9;
}

.weekly-table tbody tr:nth-child(odd) .available-slot,
.weekly-table tbody tr:nth-child(odd) .available-slot.occupied-slot {
  background: #ecfdf5;
}

.weekly-table tbody tr:nth-child(even) .available-slot,
.weekly-table tbody tr:nth-child(even) .available-slot.occupied-slot {
  background: #dcfce7;
}

.weekly-table tbody tr:nth-child(odd) .unavailable-slot,
.weekly-table tbody tr:nth-child(odd) .unavailable-slot.occupied-slot {
  background: #f8fafc;
}

.weekly-table tbody tr:nth-child(even) .unavailable-slot,
.weekly-table tbody tr:nth-child(even) .unavailable-slot.occupied-slot {
  background: #e2e8f0;
}

.weekly-table .available-slot.occupied-slot .weekly-slot-link {
  opacity: 1;
}

.weekly-table .situation-2,
.weekly-table .situation-2 .weekly-slot-link,
.weekly-table .situation-2 .weekly-slot-time,
.weekly-table .situation-2 .weekly-patient-code,
.weekly-table .situation-2 .weekly-patient-name {
  color: #0000ff;
}

.weekly-table .situation-3,
.weekly-table .situation-3 .weekly-slot-link,
.weekly-table .situation-3 .weekly-slot-time,
.weekly-table .situation-3 .weekly-patient-code,
.weekly-table .situation-3 .weekly-patient-name {
  color: #ff0000;
}

.weekly-table .situation-4,
.weekly-table .situation-4 .weekly-slot-link,
.weekly-table .situation-4 .weekly-slot-time,
.weekly-table .situation-4 .weekly-patient-code,
.weekly-table .situation-4 .weekly-patient-name {
  color: #008000;
}

.weekly-table .situation-5,
.weekly-table .situation-5 .weekly-slot-link,
.weekly-table .situation-5 .weekly-slot-time,
.weekly-table .situation-5 .weekly-patient-code,
.weekly-table .situation-5 .weekly-patient-name {
  color: #800020;
}

.weekly-table .situation-6,
.weekly-table .situation-6 .weekly-slot-link,
.weekly-table .situation-6 .weekly-slot-time,
.weekly-table .situation-6 .weekly-patient-code,
.weekly-table .situation-6 .weekly-patient-name {
  color: #6b7280;
}

.weekly-table .situation-7,
.weekly-table .situation-7 .weekly-slot-link,
.weekly-table .situation-7 .weekly-slot-time,
.weekly-table .situation-7 .weekly-patient-code,
.weekly-table .situation-7 .weekly-patient-name {
  color: #ff0000;
}

.weekly-table .situation-1,
.weekly-table .situation-1 .weekly-slot-link,
.weekly-table .situation-1 .weekly-slot-time,
.weekly-table .situation-1 .weekly-patient-code,
.weekly-table .situation-1 .weekly-patient-name {
  color: #0f766e;
}

.print-page {
  background: #fff;
  color: #111827;
}

.print-page-landscape {
  background: #fff;
}

@media print {
  .print-page-landscape {
    width: 100%;
  }

  @page print-landscape {
    size: A4 landscape;
    margin: 10mm;
  }

  .print-page-landscape {
    page: print-landscape;
  }
}

.print-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.print-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  border-bottom: 2px solid #111827;
  padding-bottom: 14px;
}

.print-table-wrap {
  overflow-x: auto;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.print-table th,
.print-table td {
  border: 1px solid #d1d5db;
  padding: 8px 9px;
  white-space: normal;
}

.print-table th {
  background: #f3f4f6;
  color: #111827;
}

.weekly-print-table th,
.weekly-print-table td {
  font-size: 11px;
  line-height: 1.25;
  padding: 5px 6px;
  vertical-align: top;
  text-align: left;
}

.weekly-print-table th {
  text-align: center;
}

.weekly-print-cell {
  min-width: 0;
  max-width: 100%;
}

.weekly-print-code,
.weekly-print-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-print-code {
  font-weight: 800;
}

.weekly-print-name {
  margin-top: 2px;
  color: #475569;
  font-weight: 500;
}

.cash-report-table th,
.cash-report-table td {
  font-size: 11px;
  line-height: 1.25;
  padding: 5px 6px;
}

.cash-panel {
  margin-bottom: 18px;
}

.cash-filter .form-grid {
  align-items: end;
}

.cash-consultation-filter-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.cash-consultation-filter-grid .cash-filter-start,
.cash-consultation-filter-grid .cash-filter-end {
  grid-column: span 3;
}

.cash-consultation-filter-grid .cash-filter-register {
  grid-column: span 4;
}

.cash-consultation-filter-grid .cash-filter-actions {
  grid-column: span 2;
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: nowrap;
  padding-bottom: 1px;
}

.cash-filter-actions {
  display: flex;
  grid-column: span 6;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .cash-consultation-filter-grid .cash-filter-start,
  .cash-consultation-filter-grid .cash-filter-end,
  .cash-consultation-filter-grid .cash-filter-register,
  .cash-consultation-filter-grid .cash-filter-actions {
    grid-column: span 6;
  }
}

@media (max-width: 620px) {
  .cash-consultation-filter-grid .cash-filter-start,
  .cash-consultation-filter-grid .cash-filter-end,
  .cash-consultation-filter-grid .cash-filter-register,
  .cash-consultation-filter-grid .cash-filter-actions {
    grid-column: 1 / -1;
  }

  .cash-consultation-filter-grid .cash-filter-actions {
    flex-wrap: wrap;
  }
}

.commission-filter-grid .field.small {
  grid-column: span 1;
}

.commission-filter-grid .commission-professional-field {
  grid-column: span 4;
}

.commission-filter-grid .commission-period-start {
  grid-column: 6 / span 2;
}

.commission-filter-grid .commission-period-field {
  grid-column: span 2;
}

.commission-filter-grid .cash-filter-actions {
  grid-column: 10 / -1;
  justify-content: flex-end;
}

.commission-totalizer {
  display: grid;
  grid-column: 7 / span 3;
  width: 80%;
  gap: 6px;
}

.commission-rate-field {
  grid-column: 4 / span 3;
  width: 80%;
}

/* Medidas compactas dos filtros de comissão e comissão de pacote. */
@media (min-width: 1051px) {
  .commission-filter-grid { grid-template-columns: 70px 210px 155px 155px minmax(170px, 1fr) auto auto; gap: 8px; }
  .commission-filter-grid .field.small { grid-column: 1; grid-row: 1; width: auto; }
  .commission-filter-grid .commission-professional-field { grid-column: 2; grid-row: 1; width: auto; }
  .commission-filter-grid .commission-period-field.commission-period-start { grid-column: 3; grid-row: 1; width: auto; }
  .commission-filter-grid .commission-period-field:not(.commission-period-start) { grid-column: 4; grid-row: 1; width: auto; }
  /* Na comissão simples, o total ocupa metade da coluna disponível. */
  .commission-filter-grid .commission-totalizer:not(.commission-rate-field) { grid-column: 5; grid-row: 1; width: 50%; }
  .commission-filter-grid .cash-filter-actions { grid-column: 6 / -1; grid-row: 1; justify-content: flex-end; flex-wrap: nowrap; }
  .commission-filter-grid .commission-rate-field { grid-column: 1 / span 2; grid-row: 2; width: 100%; }

  /* Pacotes: valor e total lado a lado, sem criar uma segunda linha. */
  #package-commission-filter-form .commission-filter-grid {
    grid-template-columns: 70px 210px 155px 155px minmax(145px, 1fr) minmax(145px, 1fr) auto auto;
  }

  #package-commission-filter-form .commission-filter-grid .commission-rate-field {
    grid-column: 5;
    grid-row: 1;
    width: 100%;
  }

  #package-commission-filter-form .commission-filter-grid .commission-totalizer:not(.commission-rate-field) {
    grid-column: 6;
    grid-row: 1;
    width: 100%;
  }

  #package-commission-filter-form .commission-filter-grid .cash-filter-actions {
    grid-column: 7 / -1;
    grid-row: 1;
  }
}

.commission-totalizer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.commission-totalizer strong {
  min-height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 20px;
  font-weight: 900;
  padding: 9px 12px;
  text-align: right;
}

.cash-entry-form {
  max-width: 980px;
}

.cash-entry-modern {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.cash-entry-modern > .field,
.cash-entry-modern > .cash-entry-main,
.cash-entry-modern > .cash-payment-choice-group,
.cash-entry-modern > .cash-entry-actions {
  grid-column: 1;
  min-width: 0;
  width: 100%;
}

.cash-entry-register-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 390px;
  margin: 0;
}

.cash-entry-main {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
}

.cash-choice-group,
.cash-payment-choice-group {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.cash-choice-group legend,
.cash-payment-choice-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cash-choice-group {
  align-self: stretch;
}

.cash-choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.cash-choice:has(input:checked) {
  border-color: var(--primary);
  background: #ecfdf5;
  color: var(--primary-dark);
}

.cash-choice-debit:has(input:checked) {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.cash-entry-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(180px, 0.35fr);
  gap: 14px;
  align-content: start;
}

.cash-entry-fields .field {
  grid-column: auto;
}

.cash-entry-fields .field.full {
  grid-column: 1 / -1;
}

.cash-entry-inline-date {
  display: flex;
  align-items: center;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 24px;
  font-weight: 900;
  padding: 8px 12px;
}

.cash-payment-choice-group {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cash-payment-choice-group legend {
  grid-column: 1 / -1;
}

.cash-payment-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  font-weight: 800;
}

.cash-payment-choice:has(input:checked) {
  border-color: var(--primary);
  background: #ecfdf5;
  color: var(--primary-dark);
}

.cash-entry-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.cash-table-wrap {
  overflow: auto;
}

.cash-table {
  min-width: 1680px;
}

.cash-commission-table {
  min-width: 980px;
}

.cash-table th,
.cash-table td {
  white-space: nowrap;
}

.cash-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.cash-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.cash-table tbody tr.cash-row-debit td {
  background: #fef2f2;
  color: #b91c1c;
}

.cash-table tbody tr.cash-row-debit:hover td {
  background: #fee2e2;
}

.cash-table .money-cell {
  color: var(--primary-dark);
  font-weight: 900;
  text-align: right;
}

.cash-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
}

.cash-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  border-top: 0;
}

.cash-summary-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
}

.cash-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cash-summary-card strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.cash-summary-credit {
  border-left: 4px solid #0f766e;
  background: #f0fdfa;
}

.cash-summary-credit strong {
  color: #0f766e;
}

.cash-summary-debit {
  border-left: 4px solid #dc2626;
  background: #fef2f2;
}

.cash-summary-debit strong {
  color: #b91c1c;
}

.cash-summary-general {
  border-left: 4px solid #1d4ed8;
  background: #eff6ff;
}

.cash-summary-general strong {
  color: #1d4ed8;
}

@media (max-width: 720px) {
  .cash-summary {
    grid-template-columns: 1fr;
  }
}

.cash-total span {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.cash-total strong {
  min-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #dc2626;
  font-size: 20px;
  padding: 8px 12px;
  text-align: right;
}

.compact-header {
  padding-bottom: 16px;
}

.followup-filter-grid {
  align-items: end;
}

.followup-filter-grid .field.small {
  grid-column: span 2;
}

.followup-filter-grid .field.wide {
  grid-column: span 4;
}

.followup-filter-grid .followup-professional-code {
  grid-column: 1 / 3;
}

.followup-filter-grid .followup-professional-select {
  grid-column: 3 / -1;
}

.followup-filter-grid .followup-client-code {
  grid-column: 1 / 3;
}

.followup-filter-grid .followup-client-select {
  grid-column: 3 / -1;
}

.followup-search-patient {
  display: flex;
  grid-column: 1 / 11;
  justify-content: flex-end;
}

.followup-actions {
  display: flex;
  grid-column: 11 / -1;
  justify-content: flex-end;
}

.followup-actions .button {
  min-width: 150px;
}

.followup-search-patient .button {
  min-width: 170px;
}

.followup-panel {
  margin-top: 18px;
}

.client-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
}

.summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.summary-item strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  font-weight: 700;
  min-height: 20px;
}

.followup-edit-form {
  display: grid;
  gap: 12px;
}

.followup-edit-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  min-height: 360px;
  padding: 14px;
  resize: vertical;
  white-space: pre-wrap;
  width: 100%;
}

.followup-edit-form textarea[readonly] {
  background: #f8fafc;
  color: #334155;
}

.followup-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.followup-edit-actions .button {
  min-width: 120px;
}

.followup-edit-actions .button.recording {
  border-color: #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.history-filter-grid {
  align-items: end;
}

.history-filter-grid .history-client-code {
  grid-column: span 2;
}

.history-filter-grid .history-client-select {
  grid-column: span 6;
}

.history-search-patient {
  display: flex;
  grid-column: span 2;
  justify-content: flex-end;
}

.history-actions {
  display: flex;
  grid-column: span 2;
  justify-content: flex-end;
}

.history-search-patient .button,
.history-actions .button {
  min-width: 150px;
}

.history-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-append-row {
  display: grid;
  align-items: end;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
}

.history-append-field {
  grid-column: auto;
}

.history-append-row .button {
  min-width: 120px;
}

.history-text-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.history-text-card pre {
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  min-height: 360px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.package-main-section,
.package-items-panel {
  margin-top: 0;
}

.package-main-grid {
  align-items: end;
}

.package-code-field {
  grid-column: span 2;
}

.package-client-name,
.package-select-field {
  grid-column: span 8;
}

.package-professional-code-field,
.package-attendant-code-field {
  grid-column: span 2;
}

.package-professional-name-field,
.package-attendant-name-field {
  grid-column: span 4;
}

.package-search-client {
  display: flex;
  grid-column: span 2;
  justify-content: flex-end;
}

.package-search-client .button {
  min-width: 170px;
}

.package-items-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-left: 14px;
  padding-right: 14px;
}

.package-cash-section {
  margin: 0;
}

.package-cash-field {
  max-width: 360px;
}

.package-cash-selected {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 0.95rem;
}

.package-form .field.has-error input,
.package-form .field.has-error select {
  border-color: #c0392b;
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.35);
}

.package-form .package-items-panel.has-error,
.package-form .package-payment-group.has-error {
  border-color: #c0392b;
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.25);
}

.package-item-entry {
  align-items: end;
  gap: 10px;
  grid-template-columns: minmax(82px, 0.6fr) minmax(190px, 1fr) minmax(96px, 0.55fr) minmax(110px, 0.65fr) minmax(92px, auto);
}

.package-item-entry .field {
  grid-column: auto;
  min-width: 0;
}

.package-treatment-code-field {
  grid-column: auto;
}

.package-treatment-select {
  grid-column: auto;
}

.package-quantity-field,
.package-value-field {
  grid-column: auto;
}

.package-include-action {
  display: flex;
  grid-column: auto;
  justify-content: flex-end;
  min-width: 0;
}

.package-include-action .button {
  min-width: 92px;
  padding-left: 12px;
  padding-right: 12px;
}

.package-items-table th:last-child,
.package-items-table td:last-child {
  width: 110px;
  text-align: right;
}

.package-items-table {
  min-width: 0;
  width: 100%;
}

.package-items-table th:first-child,
.package-items-table td:first-child {
  width: 90px;
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
}

.button.danger {
  border-color: #fecaca;
  background: #fff;
  color: #b91c1c;
}

.package-totals-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
}

.package-totals-grid .field {
  grid-column: auto;
}

.package-payment-group {
  margin: 0;
}

.package-card-details {
  display: none;
  gap: 12px;
  grid-template-columns: minmax(120px, 0.25fr) minmax(220px, 0.5fr);
  max-width: 560px;
}

.package-card-details.visible {
  display: grid;
}

.package-card-details .field {
  grid-column: auto;
}

.package-actions {
  display: flex;
  justify-content: flex-end;
}

.package-actions .button {
  min-width: 170px;
}

.package-consult-grid {
  align-items: end;
}

.package-consult-client-code {
  grid-column: 1 / span 2;
}

.package-consult-client-name {
  grid-column: 3 / span 7;
}

.package-consult-search {
  display: flex;
  grid-column: 10 / -1;
  justify-content: flex-end;
}

.package-consult-search .button {
  min-width: 170px;
}

.package-consult-period {
  grid-column: span 2;
}

.package-consult-actions {
  display: flex;
  grid-column: span 2;
  justify-content: flex-end;
}

.package-consult-total {
  grid-column: span 6;
}

.package-consult-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.package-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.package-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.package-result-head strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.package-result-head span,
.package-result-meta span,
.package-result-money span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.package-result-money {
  text-align: right;
}

.package-result-money strong {
  color: var(--primary-dark);
}

.package-result-meta {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 14px;
}

.package-consult-items-table {
  min-width: 0;
  width: 100%;
}

.followup-text-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 12px;
  overflow: hidden;
}

.followup-text-card h3 {
  border-bottom: 1px solid var(--line);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
  margin: 0;
  padding: 10px 14px;
  text-transform: uppercase;
}

.followup-text-card pre {
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  min-height: 160px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.followup-empty {
  margin: 10px 0 0;
}

.confirm-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #eef2f6;
}

.confirm-shell {
  width: min(560px, calc(100% - 28px));
}

.confirm-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.confirm-panel.success {
  border-color: #86efac;
}

.confirm-panel.error {
  border-color: #fecaca;
}

.confirm-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

@media print {
  body {
    background: #fff;
    font-size: 11px;
  }

  .print-shell {
    width: 100%;
    padding: 0;
  }

  .print-action {
    display: none;
  }

  .print-header {
    margin-bottom: 12px;
  }

  .cash-report-table th,
  .cash-report-table td {
    font-size: 9px;
    padding: 3px 4px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 58px;
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "sidebar"
      "main";
  }

  body.sidebar-collapsed .app-layout {
    grid-template-columns: 1fr;
  }

  .system-topbar {
    height: var(--topbar-height);
    min-height: 58px;
    padding: 8px 12px;
  }

  .topbar-spacer {
    display: none;
  }

  .topbar-controls {
    width: 100%;
  }

  .topbar-branch-form {
    flex: 1 1 55%;
    min-width: 0;
  }

  .topbar-branch-form select {
    width: 100%;
  }

  .topbar-user {
    flex: 1 1 45%;
    min-width: 0;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-brand {
    min-height: 58px;
  }

  body.sidebar-collapsed .sidebar-brand {
    justify-content: space-between;
    padding: 0 12px 0 18px;
  }

  body.sidebar-collapsed .sidebar-brand-link span,
  body.sidebar-collapsed .nav-title,
  body.sidebar-collapsed .nav-link {
    width: auto;
    padding: 8px 10px;
    color: inherit;
    justify-content: flex-start;
    text-indent: 0;
  }

  body.sidebar-collapsed .sidebar-brand-link {
    width: auto;
    justify-content: flex-start;
  }

  body.sidebar-collapsed .sidebar-brand-link span {
    display: inline;
  }

  body.sidebar-collapsed .nav-link {
    margin-left: 10px;
  }

  body.sidebar-collapsed .nav-title::before,
  body.sidebar-collapsed .nav-link::before,
  body.sidebar-collapsed .nav-single::before {
    content: none !important;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field,
  .field.small,
  .field.wide {
    grid-column: span 6;
  }

  .followup-filter-grid .field.small,
  .followup-filter-grid .field.wide,
  .followup-filter-grid .followup-professional-code,
  .followup-filter-grid .followup-professional-select,
  .followup-filter-grid .followup-client-code,
  .followup-filter-grid .followup-client-select,
  .followup-search-patient {
    grid-column: span 6;
  }

  .followup-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .client-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .package-code-field,
  .package-client-name,
  .package-select-field,
  .package-treatment-select,
  .package-quantity-field,
  .package-value-field,
  .package-search-client,
  .package-include-action {
    grid-column: span 6;
  }

  .agenda-inline-actions {
    width: 100%;
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .agenda-filter.weekly-filter .form-grid {
    flex-wrap: nowrap;
    overflow: visible;
  }

  .agenda-filter.weekly-filter .agenda-inline-actions {
    width: auto;
    flex: 1 1 auto;
    flex-wrap: nowrap;
  }

  .agenda-filter.weekly-filter .agenda-date-field,
  .agenda-filter.weekly-filter .agenda-professional-field {
    width: auto;
  }

  .agenda-date-field,
  .agenda-professional-field {
    width: 100%;
  }

  .agenda-availability-summary {
    width: 100%;
    align-items: stretch;
    margin-left: 0;
  }

  .agenda-availability-summary .weekly-availability-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .agenda-availability-summary .agenda-occupancy {
    width: 100%;
    justify-content: space-between;
  }

  .payment-grid,
  .payment-summary,
  .cash-entry-main,
  .cash-entry-fields {
    grid-template-columns: 1fr;
  }

  .cash-payment-choice-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-grid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }

  .schedule-head {
    display: none;
  }

  .schedule-day {
    grid-column: 1 / -1;
    margin-top: 6px;
  }

  .schedule-field span {
    display: block;
  }
}

@media (max-width: 620px) {
  .system-topbar {
    align-items: stretch;
  }

  .topbar-controls {
    align-items: stretch;
    gap: 8px;
  }

  .topbar-branch-form,
  .topbar-user {
    width: 50%;
  }

  .topbar-user {
    padding-left: 10px;
  }

  .topbar-branch-form span,
  .topbar-user span {
    display: none;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding: 16px 10px 26px;
  }

  .page-header,
  .actions,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    margin: -16px -10px 18px;
    padding: 16px 10px 12px;
  }

  h1 {
    font-size: 24px;
  }

  .field,
  .field.small,
  .field.wide,
  .cash-filter-actions,
  .followup-filter-grid .field.small,
  .followup-filter-grid .field.wide,
  .followup-filter-grid .followup-professional-code,
  .followup-filter-grid .followup-professional-select,
  .followup-filter-grid .followup-client-code,
  .followup-filter-grid .followup-client-select,
  .followup-search-patient,
  .followup-actions,
  .commission-filter-grid .field.small,
  .commission-filter-grid .commission-professional-field,
  .commission-filter-grid .commission-period-start,
  .commission-filter-grid .commission-period-field,
  .commission-filter-grid .commission-totalizer {
    grid-column: 1 / -1;
  }

  .client-summary-grid {
    grid-template-columns: 1fr;
  }

  .package-code-field,
  .package-client-name,
  .package-select-field,
  .package-treatment-select,
  .package-quantity-field,
  .package-value-field,
  .package-search-client,
  .package-include-action {
    grid-column: 1 / -1;
  }

  .package-totals-grid {
    grid-template-columns: 1fr;
  }

  .commission-filter-grid .cash-filter-actions {
    justify-content: flex-start;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .cash-entry-main,
  .cash-entry-fields,
  .cash-payment-choice-group {
    grid-template-columns: 1fr;
  }

  .configuration-logo-grid {
    grid-template-columns: 1fr;
  }

  .configuration-agenda-policy,
  .agenda-out-of-hours-details {
    grid-template-columns: 1fr;
  }

  .configuration-consultation-grid,
  .configuration-provider-options,
  .configuration-module-grid {
    grid-template-columns: 1fr;
  }

  .configuration-ai-panel .field {
    grid-column: 1 / -1;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-sticky-panel {
    margin: -16px -10px 18px;
  }

  .agenda-sticky-panel .page-header {
    padding: 12px 10px 8px;
  }

  .agenda-legend {
    justify-content: start;
    width: 100%;
    gap: 6px;
    font-size: 12px;
  }

  .agenda-filter .form-section {
    padding: 12px 10px;
  }

  .agenda-inline-actions .button {
    width: 100%;
  }
}
.anamnese-patient-card {
  display: grid;
  grid-template-columns: 190px minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin: 18px 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #d2dce7;
  border-radius: 10px;
}
.anamnese-patient-card input[readonly] { background: #f8fafc; }
.anamnese-patient-name { min-width: 0; }
.anamnese-panel { display: none; margin-bottom: 18px; }
.anamnese-panel.active { display: block; }
.anamnese-panel h2 { margin: 0 0 14px; }
.anamnese-tabs { gap: 6px; padding: 8px 7px 0; background: #f7f9fb; }
.anamnese-tabs .form-tab { min-height: 42px; border: 1px solid #b8c4d2; border-bottom: 0; border-radius: 8px 8px 0 0; background: #fff; color: #52657a; padding: 10px 16px; text-decoration: none; text-transform: none; }
.anamnese-tabs .form-tab:hover { border-color: #8e9eaf; background: #fff; color: #17212b; }
.anamnese-tabs .form-tab.active { border: 2px solid #17212b; border-bottom: 0; background: #087f7b; color: #fff; padding: 9px 15px 10px; }
.anamnese-date-row { display: flex; align-items: center; gap: 14px; padding: 18px 34px; border: 1px solid #d2dce7; border-radius: 7px; }
.anamnese-date-plus { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid #087f7b; border-radius: 50%; color: #087f7b; font-size: 18px; line-height: 1; }
.anamnese-summary-row, .anamnese-summary-grid > div { display: flex; justify-content: space-between; gap: 20px; padding: 20px 18px; border: 1px solid #d2dce7; border-bottom: 0; }
.anamnese-summary-row:last-child { border-bottom: 1px solid #d2dce7; }
.anamnese-summary-grid { display: grid; grid-template-columns: 1fr 1fr; }
.anamnese-summary-grid > div:first-child { border-right: 0; }
.anamnese-summary-grid > div { flex-direction: column; }
.anamnese-consulta-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anamnese-consulta-actions .button.primary { background: #2455d8; border-color: #2455d8; }
.anamnese-timer { padding: 11px 14px; color: #d33; border: 1px solid #f1b8b8; border-radius: 6px; }
.anamnese-info { flex: 1; min-width: 280px; padding: 11px 14px; color: #087879; background: #effcfb; border: 1px solid #a5ddda; border-radius: 6px; }
.anamnese-recording-area { height: 66px; margin: 16px 0 12px; border: 1px solid #a5ddda; border-radius: 6px; background: #effcfb; }
.anamnese-transcript-status { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; padding: 18px; border: 1px solid #a5ddda; border-radius: 6px; }
.anamnese-transcript-status span { grid-column: 1 / -1; color: #607087; }
.anamnese-transcription { margin-top: 18px; padding: 18px; border: 1px solid #d2dce7; border-radius: 8px; }
.anamnese-transcription h3 { margin: 0 0 8px; }
.anamnese-transcription p { margin: 0 0 10px; font-size: 12px; color: #607087; }
.anamnese-transcription textarea { width: 100%; min-height: 210px; resize: vertical; box-sizing: border-box; }
.anamnese-transcription > div { display: flex; gap: 8px; margin-top: 14px; }
@media (max-width: 760px) { .anamnese-patient-card, .anamnese-summary-grid { grid-template-columns: 1fr; } .anamnese-summary-grid > div:first-child { border-right: 1px solid #d2dce7; border-bottom: 0; } }

.financial-page { max-width: 1600px; }
.financial-entry-panel, .financial-filters, .financial-list-panel { margin: 0 0 18px; padding: 20px; background: #fff; border: 1px solid #d6e0ea; border-radius: 8px; }
.financial-entry-panel .section-heading, .financial-list-panel .section-heading { margin-bottom: 16px; }
.financial-entry-panel .section-heading h2, .financial-list-panel .section-heading h2 { margin: 0; font-size: 18px; }
.financial-entry-panel .section-heading p, .financial-list-panel .section-heading p { margin: 4px 0 0; color: #607087; font-size: 13px; }
.financial-form { display: grid; gap: 16px; }
.financial-form-section { padding: 16px; border: 1px solid #e0e7ee; border-radius: 7px; background: #fbfcfd; }
.financial-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 13px; }
.financial-section-title h3 { margin: 0; color: #1a6971; font-size: 16px; }
.financial-section-title p { margin: 0; color: #708094; font-size: 12px; }
.financial-form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; }
.financial-form-grid .field-wide { grid-column: span 3; }
.financial-identification-grid .field { grid-column: span 2; }
.financial-identification-grid .field-wide { grid-column: span 3; }
.financial-identification-grid .financial-account-description { grid-column: span 4; }
.subscription-plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.subscription-plan-grid .field {
  grid-column: span 1;
}
.subscription-plan-grid .field-full {
  grid-column: 1 / -1;
}
.subscription-plan-grid textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 4.5em;
}
.financial-value-grid .field { grid-column: span 2; }
.financial-value-grid .financial-due-date, .financial-value-grid .financial-main-value { grid-column: span 2; }
.financial-installment-section { display: grid; grid-template-columns: minmax(230px, .8fr) 1fr; align-items: end; gap: 22px; }
.financial-installment-section .financial-section-title { margin: 0; }
.financial-installment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.financial-installment-grid .field { grid-column: span 1; }
.financial-optional-fields { border-top: 1px solid #e0e7ee; padding-top: 15px; }
.financial-optional-fields summary { color: #1a6971; cursor: pointer; font-size: 13px; font-weight: 700; }
.financial-optional-fields .field { display: block; margin-top: 14px; }
.financial-optional-fields textarea { width: 100%; min-height: 78px; resize: vertical; box-sizing: border-box; }
.financial-observation-field { border-top: 1px solid #e0e7ee; padding-top: 15px; }
.financial-observation-field .field { display: block; }
.financial-observation-field textarea { width: 100%; min-height: 78px; resize: vertical; box-sizing: border-box; }
.subscription-observation-field textarea { min-height: 42px; max-height: 72px; }
.financial-installment-editor { padding: 16px; border: 1px solid #b9d9d6; border-radius: 7px; background: #f5fbfa; }
.financial-installment-editor[hidden] { display: none; }
.installment-total { display: flex; align-items: baseline; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 13px; padding: 10px 12px; border: 1px solid #d2e6e3; border-radius: 6px; background: #fff; }
.installment-total span { color: #52657a; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.installment-total strong { color: #08706d; font-size: 18px; }
.installment-total small { color: #587082; font-size: 12px; }
.installment-total small.is-invalid { color: #b23a3a; font-weight: 700; }
.installment-table { width: 100%; min-width: 580px; border-collapse: collapse; }
.installment-table th { padding: 9px 11px; background: #e8f4f2; color: #52657a; font-size: 11px; text-align: left; text-transform: uppercase; }
.installment-table td { padding: 8px 11px; border-top: 1px solid #dcebea; color: #263545; }
.installment-table input { width: 100%; box-sizing: border-box; }
.financial-catalog-form-panel { margin: 0 0 18px; padding: 20px; border: 1px solid #d6e0ea; border-radius: 8px; background: #fff; }
.financial-catalog-form-panel .section-heading { margin-bottom: 16px; }
.financial-catalog-form-panel .section-heading h2 { margin: 0; font-size: 18px; }
.financial-catalog-form-panel .section-heading p { margin: 4px 0 0; color: #607087; font-size: 13px; }
.financial-catalog-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; }
.financial-catalog-grid .field { grid-column: span 2; }
.financial-catalog-grid .field-wide { grid-column: span 3; }
.financial-catalog-grid textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.supplier-catalog-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr 1.3fr; }
.supplier-catalog-grid .catalog-field-nome, .supplier-catalog-grid .catalog-field-documento, .supplier-catalog-grid .catalog-field-contato, .supplier-catalog-grid .catalog-field-telefone, .supplier-catalog-grid .catalog-field-email, .supplier-catalog-grid .catalog-field-cep, .supplier-catalog-grid .catalog-field-numero, .supplier-catalog-grid .catalog-field-uf { grid-column: span 1; }
.supplier-catalog-grid .catalog-field-endereco { grid-column: span 2; }
.supplier-catalog-grid .catalog-field-telefone { grid-column: span 1; }
.supplier-catalog-grid .catalog-field-observacao { grid-column: span 2; }
.supplier-catalog-grid .financial-catalog-action { grid-column: span 3; align-self: end; }
.supplier-catalog-grid .financial-catalog-action { justify-content: flex-start; }
.supplier-catalog-grid .catalog-field-observacao textarea { min-height: 42px; height: 42px; resize: none; }
.category-catalog-grid { grid-template-columns: 2fr 1.2fr 2fr auto; }
.category-catalog-grid .catalog-field-nome, .category-catalog-grid .catalog-field-tipo, .category-catalog-grid .catalog-field-descricao { grid-column: auto; }
.category-catalog-grid .catalog-field-descricao textarea { min-height: 42px; height: 42px; resize: none; }
.category-catalog-grid .financial-catalog-action { grid-column: auto; align-self: end; }
.category-catalog-page .financial-catalog-table td:first-child strong { color: #087f7b; font-size: 14px; }
.cost-center-catalog-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cost-center-catalog-grid .catalog-field-codigo { grid-column: span 1; }
.cost-center-catalog-grid .catalog-field-nome { grid-column: span 3; }
.cost-center-catalog-grid .catalog-field-responsavel { grid-column: span 2; }
.cost-center-catalog-grid .catalog-field-descricao { grid-column: span 3; }
.cost-center-catalog-grid .financial-catalog-action { grid-column: 4 / -1; align-self: end; }
.cep-input-group { display: flex; gap: 6px; align-items: stretch; }
.cep-input-group input { min-width: 0; flex: 1; }
.login-input-group {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line-strong, #b8c4d2);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.login-input-group:focus-within {
  border-color: var(--primary, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.login-input-group input {
  min-width: 0;
  flex: 1;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.login-input-suffix {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  border-left: 1px solid var(--line, #d9e1ea);
  background: var(--surface-soft, #f7f9fb);
  color: var(--muted, #637083);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.login-page .login-input-group {
  width: 100%;
}
.supplier-name-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.supplier-expand-button, .supplier-view-button { display: inline-flex; width: 25px; height: 25px; flex: 0 0 25px; align-items: center; justify-content: center; padding: 0; border: 1px solid #b9cddd; border-radius: 5px; background: #f7fafc; color: #087f7b; font-size: 19px; line-height: 1; cursor: pointer; }
.supplier-expand-button:hover, .supplier-view-button:hover { border-color: #087f7b; background: #e8f6f4; }
.supplier-view-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.supplier-name-button { min-width: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: #087f7b; font: inherit; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.supplier-name-button:hover { text-decoration: underline; }
.supplier-details-row > td { padding: 0 !important; background: #f7fbfc; }
.supplier-details-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; padding: 14px 16px; border-top: 1px solid #c9e2df; border-bottom: 1px solid #c9e2df; }
.supplier-details-grid div { min-width: 0; }
.supplier-details-grid div:nth-child(7) { grid-column: span 2; }
.supplier-details-grid span, .supplier-details-grid strong { display: block; }
.supplier-details-grid span { color: #607087; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.supplier-details-grid strong { margin-top: 3px; overflow-wrap: anywhere; color: #263545; font-size: 13px; }
.cep-search-button { display: inline-flex; width: 42px; min-width: 42px; align-items: center; justify-content: center; border: 1px solid #087f7b; border-radius: 6px; background: #087f7b; color: #fff; cursor: pointer; }
.cep-search-button:hover { background: #056864; border-color: #056864; }
.cep-search-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.financial-catalog-action { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 2px; }
.financial-catalog-table { min-width: 760px; }
.table-text-action { border: 0; padding: 0; color: #087f7b; background: transparent; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.table-text-action:hover { color: #055d5a; text-decoration: underline; }
.financial-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.financial-catalog-table .financial-row-actions { justify-content: flex-start; min-width: 132px; }
.financial-catalog-table .financial-row-actions .compact-button { width: 54px; justify-content: center; box-sizing: border-box; }
.financial-catalog-table .financial-row-actions form { display: flex; width: 70px; margin: 0; }
.financial-catalog-table .financial-row-actions .table-text-action { width: 70px; padding: 0; text-align: left; }
.compact-button { min-height: 34px; padding: 7px 10px; font-size: 12px; text-decoration: none; }
.cash-register-page { max-width: 1500px; }
.cash-register-form-panel, .cash-register-list-panel { margin: 0 0 18px; padding: 20px; border: 1px solid #d6e0ea; border-radius: 8px; background: #fff; }
.cash-register-form-panel .section-heading, .cash-register-list-panel .section-heading { margin-bottom: 16px; }
.cash-register-form-panel .section-heading h2, .cash-register-list-panel .section-heading h2 { margin: 0; font-size: 18px; }
.cash-register-form-panel .section-heading p, .cash-register-list-panel .section-heading p { margin: 4px 0 0; color: #607087; font-size: 13px; }
.cash-register-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; }
.cash-register-grid .field { grid-column: span 2; }.cash-register-grid .field-wide { grid-column: span 3; }.cash-register-grid textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.cash-register-options { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; padding-top: 2px; }
.toggle-field { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; padding: 12px; border: 1px solid #d6e0ea; border-radius: 7px; cursor: pointer; }.toggle-field input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: #087f7b; }.toggle-field strong, .toggle-field small { display: block; }.toggle-field strong { color: #24384b; font-size: 13px; }.toggle-field small { margin-top: 3px; color: #6b7c8e; font-size: 12px; }.cash-default-toggle { border-color: #8fcac2; background: #f3fbfa; }
.cash-register-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 2px; }.cash-register-table { min-width: 800px; }.cash-default-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; background: #e2f5f1; color: #08706d; font-size: 11px; font-weight: 700; }
.payment-cash-register { min-width: 210px; padding-left: 14px; border-left: 3px solid #1b9787; }
.payment-cash-register strong { color: #08706d; }
.payment-cash-register select { display: block; width: 100%; margin-top: 4px; color: #08706d; font-weight: 700; }
.dre-page { max-width: 1360px; }.dre-filter-panel, .dre-panel { margin: 0 0 18px; padding: 20px; border: 1px solid #d6e0ea; border-radius: 8px; background: #fff; }.dre-filter-row { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }.dre-filter-row .field { width: 190px; }.dre-filter-row .button { min-height: 42px; }.dre-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }.dre-summary-card { min-height: 98px; padding: 16px 18px; border: 1px solid #d6e0ea; border-left: 4px solid #607087; border-radius: 7px; background: #fff; }.dre-summary-card span { display: block; color: #52657a; font-size: 12px; font-weight: 700; text-transform: uppercase; }.dre-summary-card strong { display: block; margin-top: 9px; color: #1d2d3d; font-size: 24px; }.dre-summary-card.revenue { border-left-color: #087f7b; }.dre-summary-card.costs { border-left-color: #d99a18; }.dre-summary-card.profit { border-left-color: #15966a; }.dre-summary-card.loss { border-left-color: #d44747; }.dre-panel .section-heading { margin-bottom: 14px; }.dre-panel .section-heading h2 { margin: 0; font-size: 18px; }.dre-panel .section-heading p { margin: 4px 0 0; color: #607087; font-size: 13px; }.dre-chart-panel[hidden] { display: none; }.dre-chart-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }.dre-chart-type-switch { display: inline-flex; flex-wrap: wrap; gap: 8px; padding: 4px; border: 1px solid #d6e0ea; border-radius: 8px; background: #f5f8fb; }.dre-chart-type-btn { min-height: 36px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #52657a; font-size: 13px; font-weight: 700; cursor: pointer; }.dre-chart-type-btn:hover { color: #1d2d3d; background: #fff; }.dre-chart-type-btn.is-active { border-color: #c5d3e0; background: #fff; color: #08706d; box-shadow: 0 1px 2px rgba(29, 45, 61, 0.06); }.dre-chart-view[hidden] { display: none; }.dre-chart { display: grid; gap: 13px; }.dre-chart-row { display: grid; grid-template-columns: 190px minmax(180px, 1fr) 150px; align-items: center; gap: 14px; }.dre-chart-label { color: #35495b; font-size: 13px; font-weight: 700; }.dre-chart-track { height: 20px; overflow: hidden; border-radius: 999px; background: #edf2f6; }.dre-chart-track span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: #607087; }.dre-chart-row.revenue .dre-chart-track span { background: #087f7b; }.dre-chart-row.profit .dre-chart-track span { background: #15966a; }.dre-chart-row.costs .dre-chart-track span { background: #d99a18; }.dre-chart-row.commission .dre-chart-track span { background: #7a6bd8; }.dre-chart-row.result .dre-chart-track span { background: #2455d8; }.dre-chart-row.negative .dre-chart-track span { background: #d44747; }.dre-chart-row strong { color: #1b2d3d; text-align: right; }.dre-chart-horizontal { gap: 11px; }.dre-hbar-row { display: grid; grid-template-columns: minmax(160px, 220px) minmax(160px, 1fr) 140px; align-items: center; gap: 12px; }.dre-hbar-meta { display: grid; gap: 2px; min-width: 0; }.dre-hbar-label { overflow: hidden; color: #35495b; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }.dre-hbar-type { color: #6a7c8d; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }.dre-hbar-track { height: 22px; overflow: hidden; border-radius: 6px; background: #edf2f6; }.dre-hbar-track span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: #607087; transition: width 0.25s ease; }.dre-hbar-row.variable .dre-hbar-track span { background: #d99a18; }.dre-hbar-row.fixed .dre-hbar-track span { background: #c46b2b; }.dre-hbar-row.expense .dre-hbar-track span { background: #4f6f8f; }.dre-hbar-value { color: #1b2d3d; text-align: right; font-size: 13px; }.dre-columns { display: flex; align-items: end; gap: 14px; min-height: 300px; overflow-x: auto; padding: 6px 2px 4px; }.dre-column { flex: 1 0 88px; max-width: 120px; min-width: 78px; display: grid; grid-template-rows: auto 200px auto auto; justify-items: center; gap: 7px; }.dre-column-value { color: #1b2d3d; font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2; }.dre-column-track { width: 100%; height: 200px; display: flex; align-items: flex-end; overflow: hidden; border-radius: 8px 8px 4px 4px; background: #edf2f6; }.dre-column-track span { display: block; width: 100%; min-height: 4px; border-radius: inherit; background: #4f6f8f; transition: height 0.25s ease; }.dre-column.variable .dre-column-track span { background: #d99a18; }.dre-column.fixed .dre-column-track span { background: #c46b2b; }.dre-column.expense .dre-column-track span { background: #4f6f8f; }.dre-column-label { max-width: 100%; overflow: hidden; color: #35495b; font-size: 12px; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }.dre-column-type { color: #6a7c8d; font-size: 10px; font-weight: 600; text-align: center; text-transform: uppercase; letter-spacing: 0.02em; }.dre-chart-empty { margin: 0; color: #607087; font-size: 14px; }.dre-pie-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(240px, 1fr); gap: 28px; align-items: center; }.dre-pie-chart { width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; border: 8px solid #f5f8fb; box-shadow: inset 0 0 0 1px #d6e0ea; }.dre-pie-legend { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }.dre-pie-legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; }.dre-pie-swatch { width: 14px; height: 14px; border-radius: 4px; }.dre-pie-legend-text { min-width: 0; display: grid; gap: 2px; }.dre-pie-legend-text strong { overflow: hidden; color: #1d2d3d; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.dre-pie-legend-text small { color: #6a7c8d; font-size: 11px; }.dre-pie-legend-value { color: #1b2d3d; font-size: 13px; white-space: nowrap; }.dre-lines { border: 1px solid #dfe7ee; border-radius: 7px; overflow: hidden; }.dre-line { display: flex; justify-content: space-between; gap: 20px; padding: 13px 16px; border-top: 1px solid #e4ebf1; color: #35495b; }.dre-line:first-child { border-top: 0; }.dre-line strong { color: #1b2d3d; }.dre-line.main { background: #effaf8; color: #08706d; font-weight: 700; }.dre-line.subtotal { background: #f5f8fb; font-weight: 700; }.dre-line.result { font-size: 16px; font-weight: 800; }.dre-line.result.positive { background: #e9f8f0; color: #087550; }.dre-line.result.negative { background: #fff0f0; color: #b23a3a; }.dre-category-table { min-width: 650px; }
.dre-period-note { margin: 12px 0 0; color: #607087; font-size: 13px; }
.dre-summary-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dre-summary-card small { display: block; margin-top: 8px; color: #607087; font-size: 12px; font-weight: 600; }
.dre-summary-card small.up { color: #087550; }
.dre-summary-card small.down { color: #b23a3a; }
.dre-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dre-kpi-card { padding: 14px 16px; border: 1px solid #d6e0ea; border-radius: 7px; background: #f8fafc; }
.dre-kpi-card span { display: block; color: #52657a; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.dre-kpi-card strong { display: block; margin-top: 8px; color: #1d2d3d; font-size: 20px; }
.dre-kpi-card small { display: block; margin-top: 6px; color: #6a7c8d; font-size: 12px; }
.dre-lines-complete .dre-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 150px; align-items: center; gap: 12px; }
.dre-lines-complete .dre-line em { color: #6a7c8d; font-style: normal; font-size: 12px; font-weight: 700; text-align: right; }
.dre-lines-complete .dre-line strong { text-align: right; }
.dre-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.dre-two-col .dre-panel { margin-bottom: 0; }
.dre-compare-table td.pos, .dre-compare-table td.neg, .financial-table td.pos, .financial-table td.neg { font-weight: 700; }
.dre-compare-table td.pos, .financial-table td.pos { color: #087550; }
.dre-compare-table td.neg, .financial-table td.neg { color: #b23a3a; }
.dre-payment-list { display: grid; gap: 12px; }
.dre-payment-row { display: grid; grid-template-columns: 110px minmax(120px, 1fr) 120px 56px; gap: 10px; align-items: center; }
.dre-payment-row.total { padding-top: 10px; border-top: 1px solid #e4ebf1; font-weight: 700; grid-template-columns: 1fr auto; }
.dre-payment-row em { color: #6a7c8d; font-style: normal; font-size: 12px; text-align: right; }
.dre-payment-row strong { text-align: right; }
.dre-notes { margin: 0; padding-left: 18px; color: #35495b; line-height: 1.55; }
.dre-notes li + li { margin-top: 8px; }
@media (max-width: 1100px) {
  .dre-summary-grid-wide, .dre-kpi-grid, .dre-two-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .dre-chart-row, .dre-hbar-row { grid-template-columns: 1fr; gap: 6px; }
  .dre-chart-row strong, .dre-hbar-value { text-align: left; }
  .dre-pie-layout { grid-template-columns: 1fr; }
  .dre-column { flex-basis: 72px; min-width: 72px; }
  .dre-summary-grid-wide, .dre-kpi-grid, .dre-two-col { grid-template-columns: 1fr; }
  .dre-lines-complete .dre-line { grid-template-columns: 1fr; gap: 4px; }
  .dre-lines-complete .dre-line em, .dre-lines-complete .dre-line strong { text-align: left; }
  .dre-payment-row { grid-template-columns: 1fr; }
}
.financial-filter-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: end; }
.financial-filter-row .report-search-field { grid-column: span 3; }
.financial-filter-row .report-status-field { grid-column: span 2; }
.financial-filter-row .report-start-field, .financial-filter-row .report-end-field { grid-column: span 2; }
.financial-filter-row .button { min-height: 42px; white-space: nowrap; }
.financial-reports-search-button { grid-column: span 1; background: #2d9b68; border-color: #2d9b68; color: #fff; }
.financial-reports-search-button:hover { background: #227b52; border-color: #227b52; }
.financial-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.financial-summary-card { min-height: 92px; padding: 16px 18px; border: 1px solid #d6e0ea; border-left: 4px solid #607087; border-radius: 7px; background: #fff; }
.financial-summary-card span { display: block; color: #52657a; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.financial-summary-card strong { display: block; margin-top: 8px; color: #17212b; font-size: 23px; }
.financial-summary-card.warning { border-left-color: #d99a18; }.financial-summary-card.danger { border-left-color: #d44747; }.financial-summary-card.success { border-left-color: #15966a; }
.table-scroll { overflow-x: auto; }.financial-table { width: 100%; border-collapse: collapse; min-width: 1040px; }.financial-table th { padding: 11px 12px; background: #f3f6f9; color: #52657a; font-size: 11px; text-align: left; text-transform: uppercase; }.financial-table td { padding: 13px 12px; border-top: 1px solid #e2e8ef; color: #263545; vertical-align: middle; }.financial-table td strong, .financial-table td span, .financial-table td small { display: block; }.financial-table td span, .financial-table td small { margin-top: 3px; color: #66778a; font-size: 12px; }.empty-table { padding: 34px !important; color: #66778a; text-align: center; }
.status-pill { display: inline-flex !important; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: 11px !important; font-weight: 700; }.status-pill.aberto { background: #fff5db; color: #9b6900; }.status-pill.vencido { background: #ffe7e7; color: #ae2929; }.status-pill.parcial { background: #e8f0ff; color: #1d5ba7; }.status-pill.pago { background: #def7ed; color: #087550; }
.icon-action { width: 34px; height: 34px; border: 0; border-radius: 6px; background: #087f7b; color: #fff; font-weight: 800; cursor: pointer; }.icon-action:hover { background: #056864; }
.settle-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 18px 55px rgba(19, 34, 49, .3); }.settle-dialog::backdrop { background: rgba(14, 28, 42, .45); }.settle-dialog form { padding: 22px; }.dialog-heading { display: flex; justify-content: space-between; gap: 18px; }.dialog-heading h2 { margin: 2px 0 0; font-size: 19px; }.dialog-close { width: 32px; height: 32px; border: 0; border-radius: 5px; background: #eef2f6; color: #42566b; cursor: pointer; }.settle-balance { margin: 16px 0; padding: 12px; background: #edf8f7; color: #08706d; border-radius: 6px; font-weight: 700; }.dialog-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.dialog-fields .field-wide { grid-column: 1 / -1; }.settle-cash-fixed { display: block; padding: 10px 12px; border: 1px solid #d7e0e8; border-radius: 6px; background: #f7fafc; color: #243746; font-weight: 700; }.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.button.whatsapp-action { display: inline-flex; align-items: center; gap: 8px; background: #25d366; border-color: #1ebe57; color: #fff; }
.button.whatsapp-action:hover { background: #1ebe57; color: #fff; }
.whatsapp-icon { width: 18px; height: 18px; display: block; flex: 0 0 auto; }
@media (max-width: 1050px) { .financial-form-grid, .financial-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.financial-identification-grid .field, .financial-identification-grid .field-wide, .financial-identification-grid .financial-account-description, .financial-value-grid .field, .financial-value-grid .financial-due-date, .financial-value-grid .financial-main-value, .financial-catalog-grid .field, .financial-catalog-grid .field-wide, .supplier-catalog-grid .field { grid-column: span 1; }.financial-installment-section { grid-template-columns: 1fr; }.financial-filter-row { grid-template-columns: 1fr 1fr; }.financial-filter-row .report-search-field, .financial-filter-row .report-status-field, .financial-filter-row .report-start-field, .financial-filter-row .report-end-field { grid-column: span 1; }.financial-filter-row .report-search-field { grid-column: span 2; }.financial-filter-row .financial-reports-search-button { grid-column: span 2; justify-self: start; }.filter-search { grid-column: span 2; }.financial-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.subscription-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.subscription-plan-grid .field-full { grid-column: 1 / -1; } }
@media (max-width: 620px) { .financial-entry-panel, .financial-filters, .financial-list-panel, .financial-catalog-form-panel, .cash-register-form-panel, .cash-register-list-panel { padding: 14px; }.financial-form-grid, .financial-filter-row, .financial-summary-grid, .dialog-fields, .financial-installment-grid, .financial-catalog-grid, .cash-register-grid { grid-template-columns: 1fr; }.financial-form-grid .field-wide, .financial-identification-grid .field, .financial-identification-grid .field-wide, .financial-value-grid .field, .financial-value-grid .financial-due-date, .financial-value-grid .financial-main-value, .financial-catalog-grid .field, .financial-catalog-grid .field-wide, .cash-register-grid .field, .cash-register-grid .field-wide, .filter-search { grid-column: span 1; }.financial-section-title { display: block; }.financial-section-title p { margin-top: 4px; }.financial-filter-row .button, .financial-catalog-action .button, .cash-register-actions .button { width: 100%; }.financial-catalog-action, .cash-register-actions { display: block; }.financial-summary-card strong { font-size: 20px; }.subscription-plan-grid { grid-template-columns: 1fr; }.subscription-plan-grid .field, .subscription-plan-grid .field-full { grid-column: span 1; } }


/* === Anamnese === */

.anamnesis-header {
  position: static;
  margin-bottom: 0;
}

.anamnesis-view-tabs {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 0 -18px 18px;
  padding: 8px 18px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.anamnesis-view-tab {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.anamnesis-view-tab:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.anamnesis-view-tab.active,
.anamnesis-view-tab.active:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.anamnesis-new-consultation-tab {
  font-family: inherit;
  cursor: pointer;
}

.anamnesis-new-consultation {
  margin-top: 18px;
}

.anamnesis-new-consultation .form-section {
  border-bottom: 0;
}

.anamnesis-new-consultation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.anamnesis-new-consultation-actions .anamnesis-clear-transcription-button {
  margin-left: auto;
}

.anamnesis-audio-live-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #9bd7d2;
  border-radius: 6px;
  background: #ecfdf9;
  color: #0f3f3b;
  font-size: 0.84rem;
  font-weight: 700;
}

.anamnesis-audio-spectrum {
  display: flex;
  align-items: center;
  height: 66px;
  gap: 4px;
  margin-top: 16px;
  padding: 10px 14px;
  overflow: hidden;
  border: 1px solid #b7dedb;
  border-radius: 6px;
  background: #f0fdfa;
}

.anamnesis-audio-spectrum span {
  display: block;
  width: 100%;
  min-width: 4px;
  max-width: 18px;
  height: 12%;
  border-radius: 4px;
  background: #0f766e;
  transition: height 70ms linear;
}

.anamnesis-audio-progress {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #b7dedb;
  border-radius: 6px;
  background: #f8fffd;
}

.anamnesis-audio-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #0f3f3b;
  font-size: 0.88rem;
  font-weight: 700;
}

.anamnesis-audio-progress-bar {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7eeee;
}

.anamnesis-audio-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #0f766e;
  transition: width 180ms ease;
}

.anamnesis-audio-progress-details {
  margin-top: 8px;
  color: #4b6562;
  font-size: 0.82rem;
}

.anamnesis-new-consultation-actions .audio-start-button {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.anamnesis-new-consultation-actions .audio-start-button:hover {
  border-color: #1e40af;
  background: #1e40af;
  color: #fff;
}

.anamnesis-new-consultation-actions .audio-pause-button {
  border-color: #fca5a5;
  background: #fecaca;
  color: #991b1b;
}

.anamnesis-new-consultation-actions .audio-pause-button:hover {
  border-color: #f87171;
  background: #fca5a5;
  color: #7f1d1d;
}

.anamnesis-new-consultation-actions .audio-resume-button {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.anamnesis-new-consultation-actions .audio-resume-button:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.anamnesis-new-consultation-actions .audio-finish-button {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.anamnesis-new-consultation-actions .audio-finish-button:hover {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}



/* === Anamnese (resumo/docs/audio) === */
.prescription-client-grid {
  align-items: end;
}

.prescription-client-select {
  grid-column: span 6;
}

.prescription-client-code {
  grid-column: span 2;
}

.prescription-client-actions {
  grid-column: span 4;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.prescription-form,
.prescription-history {
  margin-top: 18px;
}

.prescription-client-code {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.prescription-patient-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prescription-patient-actions .button {
  min-height: 34px;
}

.anamnesis-summary {
  margin-top: 18px;
}

.anamnesis-audio-result {
  margin-top: 18px;
}

.anamnesis-audio-result .prescription-actions {
  padding: 0 18px 18px;
  background: #fff;
}

.anamnesis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.anamnesis-section {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.anamnesis-section:nth-child(even) {
  border-right: 0;
}

.anamnesis-section-wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.anamnesis-section h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.anamnesis-medication-section {
  padding: 0;
}

.anamnesis-medication-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.anamnesis-medication-grid article {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.anamnesis-medication-grid article:last-child {
  border-right: 0;
}

.anamnesis-edit-form {
  display: contents;
}

.anamnesis-inline-editor {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.anamnesis-inline-editor-large {
  min-height: 170px;
}

.anamnesis-inline-editor:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.14);
}

.anamnesis-section p,
.anamnesis-section li {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.anamnesis-dated-values {
  display: grid;
  gap: 10px;
}

.anamnesis-dated-value {
  border-left: 3px solid var(--primary);
  padding: 2px 0 2px 12px;
}

.anamnesis-dated-value h3 {
  color: var(--primary-dark);
  font-size: 13px;
  margin: 0 0 5px;
}

.anamnesis-dated-value p,
.anamnesis-dated-value ul {
  margin: 0;
}

.anamnesis-section p {
  margin: 0 0 8px;
}

.anamnesis-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.anamnesis-date-groups {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.anamnesis-date-group {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.anamnesis-date-group:last-child {
  border-bottom: 0;
}

.anamnesis-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding-right: 12px;
}

.anamnesis-date-toggle {
  flex: 1 1 auto;
  width: auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 16px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.anamnesis-date-symbol {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  border: 1px solid var(--primary);
  border-radius: 50%;
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.anamnesis-token-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.anamnesis-date-toggle:hover,
.anamnesis-date-toggle:focus-visible {
  background: var(--surface-soft);
}

.anamnesis-date-toggle[aria-expanded="true"] {
  background: #e6fffb;
  color: var(--primary-dark);
}

.anamnesis-date-toggle[aria-expanded="true"] .anamnesis-date-symbol {
  border-color: var(--primary-dark);
  color: var(--primary-dark);
}

.anamnesis-date-summary {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.anamnesis-document-tabs {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 12px 18px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.anamnesis-document-tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.anamnesis-document-tab:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.anamnesis-document-tab.active,
.anamnesis-document-tab.active:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.anamnesis-edit-button,
.anamnesis-edit-save-button,
.anamnesis-edit-cancel-button,
.anamnesis-delete-button {
  min-height: 34px;
  margin: 0 0 2px;
  padding: 0 13px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.anamnesis-edit-button {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--primary-dark);
}

.anamnesis-edit-save-button {
  margin-left: auto;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.anamnesis-edit-cancel-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
}

.anamnesis-delete-button {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.anamnesis-date-group.is-editing .anamnesis-edit-button,
.anamnesis-date-group.is-editing .anamnesis-delete-button {
  display: none;
}

.anamnesis-delete-button:hover,
.anamnesis-delete-button:focus-visible {
  border-color: #fca5a5;
  background: #ffe4e6;
}

.anamnesis-delete-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.anamnesis-delete-dialog::backdrop {
  background: rgba(23, 33, 43, 0.45);
}

.anamnesis-delete-alert {
  margin: 12px 18px 0;
}

.anamnesis-delete-dialog form {
  padding: 24px;
}

.anamnesis-delete-dialog-content {
  padding: 24px;
}

.anamnesis-delete-dialog h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.anamnesis-delete-dialog p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.anamnesis-delete-warning {
  color: var(--muted);
  font-size: 13px;
}

.anamnesis-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.anamnesis-delete-confirm {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}

.anamnesis-delete-confirm:hover,
.anamnesis-delete-confirm:focus-visible {
  border-color: #991b1b;
  background: #991b1b;
}

.anamnesis-document-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.anamnesis-document-panel[hidden] {
  display: none !important;
}

.anamnesis-document-text {
  min-height: 300px;
  margin-top: 8px;
  line-height: 1.6;
}

.anamnesis-document-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.anamnesis-date-summary[hidden] {
  display: none !important;
}

.anamnesis-date-group .prescription-records {
  padding: 12px 0 0 12px;
}

.prescription-textarea {
  min-height: 300px;
  font-size: 15px;
  line-height: 1.6;
}

.anamnesis-clear-transcription-button {
  border-color: #f1b8b8;
  background: #fff7f7;
  color: #9f1d1d;
  font-weight: 800;
}

.anamnesis-clear-transcription-button:hover {
  border-color: #dc8b8b;
  background: #fee2e2;
  color: #7f1d1d;
}

.prescription-actions {
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.prescription-audio-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  min-width: 0;
  margin-left: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.prescription-audio-status.is-generating {
  min-width: min(360px, 45vw);
  padding-bottom: 9px;
}

.prescription-audio-status.is-generating::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7eeee;
}

.prescription-audio-status.is-generating::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 38%;
  height: 4px;
  border-radius: 999px;
  background: #0f766e;
  animation: anamnesis-generate-progress 1.1s ease-in-out infinite;
}

@keyframes anamnesis-generate-progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(275%);
  }
}

.audio-recording-timer {
  align-items: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #b91c1c;
  display: inline-flex;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
}

.prescription-records {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.prescription-record {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 14px;
}

.prescription-record > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.prescription-record > div strong {
  color: var(--text);
}

.prescription-record pre {
  margin: 10px 0 0;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 620px) {
  .anamnesis-date-row {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    padding-right: 0;
  }

  .anamnesis-date-toggle {
    flex-basis: 100%;
  }

  .anamnesis-document-tabs {
    padding: 10px 12px 0;
  }
}

@media (max-width: 620px) {
  .side-nav {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding: 16px 10px 26px;
  }

  .page-header,
  .actions,
  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    margin: -16px -10px 18px;
    padding: 16px 10px 12px;
  }

  .anamnesis-view-tabs {
    margin: 0 -10px 18px;
    padding: 8px 10px 0;
  }

  .anamnesis-header {
    margin-bottom: 0;
  }

  .anamnesis-view-tab {
    min-height: 40px;
    padding: 0 13px;
  }

  h1 {
    font-size: 24px;
  }

  .field,
  .field.small,
  .field.wide,
  .cash-filter-actions,
  .followup-filter-grid .field.small,
  .followup-filter-grid .field.wide,
  .followup-filter-grid .followup-professional-code,
  .followup-filter-grid .followup-professional-select,
  .followup-filter-grid .followup-client-code,
  .followup-filter-grid .followup-client-select,
  .followup-search-patient,
  .followup-actions,
  .commission-filter-grid .field.small,
  .commission-filter-grid .commission-professional-field,
  .commission-filter-grid .commission-period-start,
  .commission-filter-grid .commission-period-field,
  .commission-filter-grid .commission-totalizer {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .client-summary-grid {
    grid-template-columns: 1fr;
  }

  .package-code-field,
  .package-client-name,
  .package-select-field,
  .package-treatment-select,
  .package-quantity-field,
  .package-value-field,
  .package-search-client,
  .package-include-action {
    grid-column: 1 / -1;
  }

  .package-totals-grid {
    grid-template-columns: 1fr;
  }

  .commission-filter-grid .cash-filter-actions {
    justify-content: flex-start;
  }

  .prescription-client-code,
  .prescription-client-select,
  .prescription-client-actions {
    grid-column: 1 / -1;
  }

  .prescription-client-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .cash-entry-main,
  .cash-entry-fields,
  .cash-payment-choice-group {
    grid-template-columns: 1fr;
  }

  .configuration-logo-grid {
    grid-template-columns: 1fr;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }

  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-sticky-panel {
    margin: -16px -10px 18px;
  }

  .agenda-sticky-panel .page-header {
    padding: 12px 10px 8px;
  }

  .agenda-legend {
    justify-content: start;
    width: 100%;
    gap: 6px;
    font-size: 12px;
  }

  .agenda-filter .form-section {
    padding: 12px 10px;
  }

  .agenda-inline-actions .button {
    width: 100%;
  }

  .anamnesis-grid {
    grid-template-columns: 1fr;
  }

  .anamnesis-medication-grid {
    grid-template-columns: 1fr;
  }

  .anamnesis-medication-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .anamnesis-medication-grid article:last-child {
    border-bottom: 0;
  }

  .anamnesis-section,
  .anamnesis-section:nth-child(even) {
    border-right: 0;
  }
}


.configuration-document-letterhead-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.configuration-document-page {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 210 / 297;
  overflow: hidden;
  border: 1px solid var(--line-strong, #c9d4e0);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.08));
}

.configuration-document-page img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.configuration-document-page-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  color: var(--muted, #64748b);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 12px,
    #eef2f6 12px,
    #eef2f6 24px
  );
}

.configuration-document-page.empty .configuration-document-page-empty {
  display: grid;
}

.configuration-document-text-box {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border: 2px solid var(--primary, #087f7b);
  border-radius: 6px;
  background: rgba(8, 127, 123, 0.14);
  color: #055e5b;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.configuration-document-text-box > span {
  pointer-events: none;
  padding: 0 10px;
}

.configuration-document-resize {
  position: absolute;
  z-index: 3;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 2px;
  background: var(--primary, #087f7b);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.configuration-document-resize.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.configuration-document-resize.n { top: -7px; left: 50%; margin-left: -6px; cursor: ns-resize; }
.configuration-document-resize.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.configuration-document-resize.e { top: 50%; right: -7px; margin-top: -6px; cursor: ew-resize; }
.configuration-document-resize.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.configuration-document-resize.s { left: 50%; bottom: -7px; margin-left: -6px; cursor: ns-resize; }
.configuration-document-resize.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.configuration-document-resize.w { top: 50%; left: -7px; margin-top: -6px; cursor: ew-resize; }

.configuration-document-controls {
  display: grid;
  gap: 16px;
}

.configuration-document-area-fields {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

@media (max-width: 900px) {
  .configuration-document-letterhead-grid {
    grid-template-columns: 1fr;
  }

  .configuration-document-page {
    width: min(100%, 360px);
    margin: 0 auto;
  }
}

