:root {
  --gold: #c9912f;
  --gold-strong: #9f711f;
  --gold-soft: #fff3dc;
  --ink: #161412;
  --text: #302d29;
  --muted: #79716a;
  --line: #ebe4d8;
  --paper: #ffffff;
  --surface: #f8f6f1;
  --surface-2: #f0ece4;
  --danger: #b8493f;
  --success: #3f9f69;
  --radius: 22px;
  --shadow: 0 16px 38px rgba(35, 29, 19, 0.10);
  --header-h: auto;
}

* {
  box-sizing: border-box;
}

/* Garante que [hidden] sempre esconda o elemento, mesmo quando a classe do
   componente define "display" explicitamente (ex.: .login-view/.app-shell
   usam display:grid, que sem esta regra vencia o atributo hidden). */
[hidden] {
  display: none !important;
}

html {
  background: var(--surface);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(201, 145, 47, 0.12), transparent 26rem),
    linear-gradient(180deg, #fffdfa 0%, var(--surface) 48%, #fff 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.04;
}

h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1.2rem;
}

h3 {
  color: var(--ink);
  font-size: 1rem;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-card,
.card,
.metric-card,
.panel,
.table-card {
  border: 1px solid rgba(235, 228, 216, 0.94);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 430px);
  padding: 22px;
}

.login-remember {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-remember input {
  width: auto;
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--gold-strong);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-trial-hint {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.86rem;
}

.login-trial-hint a {
  color: var(--gold-strong);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 6px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--ink);
  object-fit: contain;
}

.brand-logo {
  display: block;
  height: auto;
  width: 100%;
  max-width: 260px;
  margin: 0 auto 18px;
}

/* ---------- Shell layout (desktop-first grid, collapses on mobile) ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.app-shell.is-afiliado {
  grid-template-columns: 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  padding: 18px;
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.nav-group + .nav-group {
  margin-top: 14px;
}

.nav-group-title {
  margin: 4px 0 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  font-weight: 850;
}

.nav-icon {
  display: inline-flex;
  width: 22px;
  flex-shrink: 0;
  justify-content: center;
  font-size: 1rem;
}

.nav-button.is-active {
  background: var(--gold-soft);
  color: var(--gold-strong);
}

.workspace {
  min-width: 0;
  padding: 18px 22px 100px;
}

/* ---------- Topbar: brand/menu row, barbearia row, user row ---------- */

.topbar {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

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

.topbar-primary {
  justify-content: space-between;
}

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

.topbar-context {
  justify-content: flex-start;
}

.barbearia-picker {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  gap: 10px;
}

.barbearia-picker span {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar-user {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 12px 6px 6px;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: var(--gold);
  font-weight: 950;
}

.user-chip-info {
  display: grid;
  line-height: 1.25;
}

.user-chip-info strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.user-chip-info span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.icon-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

/* ---------- Mobile off-canvas drawer (hidden on desktop) ---------- */

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(84vw, 320px);
  overflow-y: auto;
  background: rgba(255, 253, 250, 0.98);
  padding: 16px;
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 0.24s ease;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(22, 20, 18, 0.42);
}

button,
input,
textarea,
select {
  font: inherit;
}

.select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdfa;
  color: var(--ink);
  padding: 13px 12px;
  outline: none;
}

.select {
  min-width: 200px;
  min-height: 46px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 145, 47, 0.13);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  padding: 0 16px;
  font-weight: 950;
}

.primary-button {
  background: linear-gradient(180deg, #d8a645, var(--gold));
  color: white;
  box-shadow: 0 14px 26px rgba(201, 145, 47, 0.26);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.ghost-button {
  color: var(--gold-strong);
}

.danger-button {
  background: #fff0ee;
  color: var(--danger);
}

.content {
  display: grid;
  gap: 14px;
}

.content.is-animating {
  animation: content-in 0.22s ease;
}

@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-grid,
.module-grid,
.form-grid,
.two-col,
.three-col,
.card-list {
  display: grid;
  gap: 12px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.card,
.panel,
.table-card {
  padding: 15px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fffdfa;
  padding: 14px;
}

.module-card p {
  margin-bottom: 0;
}

.barber-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.barber-hero h2,
.barber-hero p {
  margin-bottom: 6px;
}

.new-barber-panel {
  border-style: dashed;
}

.form-intro {
  margin-bottom: 2px;
}

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

.barber-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdfa;
  padding: 12px;
  box-shadow: var(--shadow);
}

.barber-card-photo {
  overflow: hidden;
  border-radius: 17px;
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
}

.barber-card-photo img,
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.barber-card-body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.barber-card-title,
.barber-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.barber-card-title h3 {
  margin-bottom: 4px;
}

.barber-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.barber-card-meta span {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.barber-editor,
.barber-gallery-panel {
  margin-top: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdfa;
}

.gallery-card img {
  display: block;
  height: 150px;
}

.gallery-card-body {
  padding: 10px;
}

.gallery-card-body strong {
  display: block;
  color: var(--ink);
}

.gallery-card.is-off {
  opacity: 0.62;
}

.gallery-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

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

.service-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdfa;
  padding: 15px;
  box-shadow: var(--shadow);
}

.service-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.service-card-header h3 {
  margin-bottom: 5px;
}

.service-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.service-card-metrics span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  padding: 10px;
}

.service-card-metrics strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.service-card-metrics small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.service-form-panel {
  border-style: dashed;
}

.dashboard-hero,
.section-heading-row,
.agenda-toolbar,
.agenda-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-hero {
  align-items: center;
}

.dashboard-hero h2,
.dashboard-hero p,
.section-heading-row h2,
.section-heading-row p {
  margin-bottom: 5px;
}

.dashboard-main-grid {
  align-items: start;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agenda-toolbar {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 14px;
}

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

.agenda-list.compact {
  gap: 8px;
}

.agenda-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 18px;
  background: #fffdfa;
  padding: 12px;
}

.agenda-card.is-done {
  border-left-color: var(--success);
}

.agenda-card.is-canceled {
  border-left-color: var(--danger);
  opacity: 0.82;
}

.agenda-card.is-pending {
  border-left-color: #8b6fd6;
}

.agenda-card.is-waiting {
  border-left-color: #f59e0b;
  background: #fffaf0;
}

.agenda-card-main {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  min-width: 0;
}

.agenda-date-box {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: var(--gold-soft);
  color: var(--gold-strong);
  text-transform: uppercase;
}

.agenda-date-box strong {
  font-size: 1.18rem;
  line-height: 1;
}

.agenda-date-box span {
  font-size: 0.68rem;
  font-weight: 950;
}

.agenda-title-row {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.agenda-title-row h3 {
  margin-bottom: 0;
}

.agenda-note {
  margin: 8px 0 0;
  border-radius: 12px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.module-placeholder-note {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
}

.module-placeholder-note p {
  margin: 0;
}

.module-placeholder {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 24px;
  text-align: center;
}

.placeholder-icon {
  font-size: 2.2rem;
}

.roadmap-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.roadmap-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.roadmap-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold-strong);
}

.list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-card-main strong {
  display: block;
  color: var(--ink);
}

.list-card-main p {
  margin: 2px 0 0;
}

.trial-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.trial-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 900;
}

.filter-chip.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-strong);
}

#trialSearchInput {
  max-width: 320px;
}

.trial-card {
  padding: 0;
  overflow: hidden;
}

.trial-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  padding: 15px;
  text-align: left;
}

.trial-card-details {
  border-top: 1px solid var(--line);
  padding: 15px;
}

.trial-card-details p {
  margin: 0 0 10px;
  font-size: 0.88rem;
}

.trial-recusa-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.trial-summary-card {
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  border: 1px solid var(--line);
  cursor: pointer;
}

.trial-summary-card > span:first-child {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.trial-summary-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text);
}

.trial-summary-rows strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.trial-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  padding: 3px 10px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.trial-relative {
  color: var(--gold-strong);
  font-weight: 800;
}

.trial-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.trial-expired {
  color: var(--danger);
  font-weight: 900;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(22, 20, 18, 0.5);
  padding: 18px;
}

.modal-box {
  width: min(100%, 480px);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: var(--radius);
  background: white;
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal-checklist {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.modal-checklist li {
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
}

.modal-actions {
  margin-top: 18px;
}

.modal-box-large {
  width: min(100%, 900px);
}

.modal-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-quick-actions {
  margin: 14px 0 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modal-section h3 {
  margin-bottom: 10px;
}

.modal-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-section-header h3 {
  margin-bottom: 0;
}

.modal-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modal-inline-form {
  margin: 12px 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--surface);
}

.notificacao-nao-lida {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.form-section-title {
  margin: 4px 0 -2px;
  color: var(--gold-strong);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-section-title:first-child {
  margin-top: 0;
}

.image-upload-field {
  display: grid;
  gap: 8px;
}

.image-upload-gallery {
  display: grid;
  gap: 18px;
}

@media (min-width: 640px) {
  .image-upload-gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
  }

  .image-upload-gallery .image-upload-field {
    flex: 0 1 auto;
  }
}

.image-upload-header {
  display: grid;
  gap: 2px;
}

.image-upload-label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.image-upload-recommendation {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.image-upload-dropzone {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.image-upload-dropzone:hover,
.image-upload-dropzone:focus-within {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.image-upload-square {
  max-width: 150px;
  aspect-ratio: 1 / 1;
}

.image-upload-wide {
  max-width: 340px;
  max-height: 140px;
  aspect-ratio: 16 / 6;
}

.image-upload-preview {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 10px;
  text-align: center;
}

.image-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-upload-icon {
  font-size: 2.1rem;
  opacity: 0.6;
}

.image-upload-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: rgba(22, 20, 18, 0.82);
  color: white;
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 900;
  backdrop-filter: blur(4px);
}

.image-upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.image-upload-status {
  margin: 0;
  font-size: 0.78rem;
}

.image-upload-remove {
  font-size: 0.78rem;
  color: var(--danger);
}

@media (max-width: 560px) {
  .image-upload-square {
    max-width: 140px;
  }

  .image-upload-wide {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 720px) {
  .modal-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.highlight-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  color: var(--text);
}

.status-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-strong);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 950;
}

.status-pill.off {
  background: #f1eeee;
  color: var(--muted);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdfa;
  padding: 10px;
  color: var(--text);
}

.check-card input {
  width: auto;
}

.empty-state {
  border: 1px dashed #d7cbb7;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
  padding: 24px;
  text-align: center;
}

.error-text {
  min-height: 22px;
  color: var(--danger);
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  border-radius: 16px;
  background: var(--ink);
  color: white;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  font-weight: 850;
}

.mobile-nav {
  display: none;
}

/* ---------- Mobile-first overrides ---------- */

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .icon-button.drawer-toggle {
    display: flex;
  }

  .workspace {
    padding: 14px 14px 92px;
  }

  .topbar-primary {
    justify-content: flex-start;
  }

  .topbar-context,
  .topbar-user {
    justify-content: stretch;
  }

  .barbearia-picker {
    flex: 1 1 auto;
    width: 100%;
  }

  .topbar-user {
    width: 100%;
  }

  .topbar-user #publicLink {
    flex: 1 1 auto;
  }

  .topbar-user .user-chip {
    flex: 1 1 auto;
  }

  .metric-grid,
  .module-grid,
  .barber-grid,
  .gallery-grid,
  .service-grid,
  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .barber-hero,
  .barber-card,
  .barber-card-title,
  .barber-editor-header,
  .dashboard-hero,
  .section-heading-row,
  .agenda-card {
    display: grid;
  }

  .barber-card {
    grid-template-columns: 96px 1fr;
  }

  .gallery-card img {
    height: 190px;
  }

  .service-card-header {
    display: grid;
  }

  .service-card-metrics {
    grid-template-columns: 1fr;
  }

  .quick-action-grid,
  .agenda-card-main {
    grid-template-columns: 1fr;
  }

  .agenda-actions {
    justify-content: stretch;
  }

  .agenda-actions button {
    flex: 1 1 120px;
  }

  .span-2 {
    grid-column: auto;
  }

  .module-card {
    min-height: 112px;
    padding: 16px;
  }

  .list-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    min-height: 48px;
  }

  /* Tabelas viram cards empilhados no mobile (sem rolagem horizontal) */
  .table-wrap {
    overflow-x: visible;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 12px;
    padding: 6px 4px;
    background: #fffdfa;
  }

  td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed var(--line);
    padding: 10px 10px;
    text-align: right;
  }

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

  td::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 950;
    text-align: left;
    text-transform: uppercase;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }

  .mobile-nav .nav-button {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    padding: 0 6px;
    font-size: 0.7rem;
    text-align: center;
  }

  .mobile-nav .nav-icon {
    width: auto;
    font-size: 1.1rem;
  }
}

@media (min-width: 981px) {
  .mobile-drawer,
  .drawer-backdrop {
    display: none;
  }
}

/* ---------- Planos e assinaturas ---------- */

.status-pill.success {
  background: #e5f6ec;
  color: var(--success);
}

.status-pill.warning {
  background: #fff3dc;
  color: #a86a12;
}

.status-pill.danger {
  background: #fdeceb;
  color: var(--danger);
}

.plan-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(235, 228, 216, 0.94);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--ink) 0%, #2c2519 62%, var(--gold-strong) 130%);
  box-shadow: var(--shadow);
  padding: 24px;
  color: #fff;
}

.plan-hero.is-blocked {
  background: linear-gradient(135deg, var(--ink) 0%, #3a231f 60%, var(--danger) 140%);
}

.plan-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-hero-title {
  margin: 0;
  font-size: 1.3rem;
}

.plan-hero-sub {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  font-weight: 700;
}

.plan-hero-days {
  display: grid;
  margin-top: 18px;
  gap: 2px;
}

.plan-hero-days strong {
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 950;
  color: var(--gold);
}

.plan-hero-days span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.plan-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.plan-hero-meta .status-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.plan-hero-cta {
  margin-top: 18px;
}

.pix-card {
  display: grid;
  gap: 16px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--gold-soft);
  box-shadow: var(--shadow);
  padding: 20px;
}

.pix-card-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}

.pix-qr {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.pix-code-row {
  display: flex;
  gap: 8px;
}

.pix-code-row input {
  flex: 1 1 auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.cycle-toggle {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px;
}

.cycle-toggle button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 900;
}

.cycle-toggle button.is-active {
  background: linear-gradient(180deg, #d8a645, var(--gold));
  color: #fff;
  box-shadow: 0 8px 18px rgba(201, 145, 47, 0.28);
}

.cycle-toggle button .save-badge {
  display: block;
  margin-top: 1px;
  font-size: 0.68rem;
  font-weight: 800;
  opacity: 0.85;
}

.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(235, 228, 216, 0.94);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.plan-card.is-recommended {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffdfa 0%, #fff 100%);
  transform: translateY(-4px);
}

.plan-card-ribbon {
  position: absolute;
  top: -12px;
  right: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d8a645, var(--gold));
  color: #fff;
  padding: 4px 14px;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 16px rgba(201, 145, 47, 0.3);
}

.plan-card-name {
  margin: 0;
  font-size: 1.2rem;
}

.plan-card-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  min-height: 40px;
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 16px 0 2px;
}

.plan-card-price strong {
  font-size: 2.1rem;
  font-weight: 950;
  color: var(--ink);
}

.plan-card-price span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.plan-card-total {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.plan-card-includes {
  margin: 0 0 8px;
  color: var(--gold-strong);
  font-size: 0.8rem;
  font-weight: 900;
}

.plan-feature-list {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.plan-feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.plan-feature-list li::before {
  content: "✓";
  display: inline-flex;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-strong);
  font-size: 0.72rem;
  font-weight: 950;
}

.plan-card-cta {
  margin-top: auto;
}

.plan-card-cta button {
  width: 100%;
}

@media (max-width: 720px) {
  .pix-card-grid {
    grid-template-columns: 1fr;
  }

  .pix-qr {
    max-width: 220px;
    margin: 0 auto;
  }

  .plan-cards-grid {
    grid-template-columns: 1fr;
  }

  .plan-card.is-recommended {
    transform: none;
  }
}

/* ---------- Clientes e fidelidade ---------- */

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: var(--gold);
}

#clienteBusca {
  margin-top: 10px;
}

.fidelidade-badge {
  margin: 6px 0 0;
  color: var(--gold-strong);
  font-size: 0.82rem;
  font-weight: 850;
}

.fidelidade-pronta {
  margin: 6px 0 0;
  color: var(--success);
  font-weight: 900;
}

.fidelidade-progress-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.progress-bar {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d8a645, var(--gold));
}

.fidelidade-config .eyebrow {
  color: var(--gold-strong);
}
