/*
 * meusClientes — design tokens from /design/index.html
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  --bg:          oklch(0.97 0.01 145);
  --sidebar:     oklch(0.25 0.07 150);
  --sidebar-hov: oklch(0.30 0.08 150);
  --card:        oklch(1 0 0);
  --card-hov:    oklch(0.975 0.015 145);
  --accent:      oklch(0.52 0.18 145);
  --accent-lt:   oklch(0.92 0.07 145);
  --accent-dark: oklch(0.38 0.14 145);
  --border:      oklch(0.88 0.03 145);
  --muted:       oklch(0.55 0.04 145);
  --danger:      oklch(0.52 0.18 25);
  --danger-lt:   oklch(0.95 0.04 25);
  --text:        oklch(0.18 0.03 145);
}

html, body { height: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

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

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(0.75 0.08 145); border-radius: 99px; }
* { scrollbar-width: thin; scrollbar-color: oklch(0.75 0.08 145) transparent; }

/* ── App shell ── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 12px;
  flex-shrink: 0;
  gap: 0;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.sidebar__logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__logo-text-muted {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.sidebar__logo-text-accent {
  color: var(--accent-lt);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
  cursor: pointer;
}

.sidebar__nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
}

.sidebar__nav-item--active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 6px;
  padding-right: 6px;
}

.sidebar__user {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  transition: color 0.15s;
  padding: 6px 4px;
  border-radius: 8px;
}

.sidebar__logout:hover {
  color: rgba(255,255,255,0.7);
}

.sidebar__footer-icon {
  flex-shrink: 0;
}

.sidebar__account-text {
  overflow: hidden;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
  padding: 28px 32px;
  gap: 0;
}

/* ── Auth wrap ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

/* ── Flash messages ── */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}

.flash--notice {
  background: var(--accent-lt);
  color: var(--accent-dark);
}

.flash--alert {
  background: var(--danger-lt);
  color: var(--danger);
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header__left { display: flex; flex-direction: column; gap: 2px; }

.page-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}

.sort-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  border-right: 1.5px solid var(--border);
}

.sort-toggle__btn:last-child { border-right: none; }

.sort-toggle__btn:hover { background: var(--card-hov); color: var(--sidebar); }

.sort-toggle__btn--active {
  background: var(--accent-lt);
  color: var(--accent-dark);
  font-weight: 600;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--sidebar);
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px oklch(0.52 0.18 145 / 0.35);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px oklch(0.52 0.18 145 / 0.45);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.btn--secondary:hover {
  background: var(--card-hov);
  color: var(--sidebar);
}

.btn--danger {
  background: var(--danger-lt);
  color: var(--danger);
  border: none;
}

.btn--danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn--success {
  background: oklch(0.94 0.07 145);
  color: oklch(0.38 0.14 145);
  border: none;
}

.btn--success:hover {
  background: oklch(0.52 0.18 145);
  color: #fff;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

/* ── Search bar ── */
.search-bar {
  margin-bottom: 20px;
}

.search-bar__wrapper {
  position: relative;
}

.search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: var(--card);
  color: var(--sidebar);
  outline: none;
  transition: border-color 0.15s;
}

.search-bar__input:focus {
  border-color: var(--accent);
}

.search-bar__filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.filter-check input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.filter-separator {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.filter-select {
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--muted);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0;
}

/* ── Client groups ── */
.client-group {
  margin-bottom: 24px;
}

.client-group__letter {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  padding-left: 2px;
}

.client-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Client card ── */
.client-card {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: all 0.15s;
  overflow: hidden;
}

.client-card:hover {
  border-color: oklch(0.52 0.18 145 / 0.35);
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  transform: translateY(-1px);
}

.client-card__link {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  cursor: pointer;
  transition: background 0.15s;
  color: inherit;
}

.client-card__link:hover {
  background: var(--card-hov);
}

.client-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.client-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sidebar);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-card__phone {
  font-size: 12px;
  color: var(--muted);
}

.client-card__total {
  font-size: 11px;
  color: var(--accent-dark);
  font-weight: 600;
}

.client-card__last-order {
  font-size: 11px;
  color: var(--muted);
}

.client-card__chevron {
  color: var(--border);
  flex-shrink: 0;
  transition: color 0.15s;
}

.client-card:hover .client-card__chevron {
  color: var(--accent);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.badge--novo {
  background: oklch(0.90 0.08 145);
  color: oklch(0.30 0.12 145);
}

.badge--recorrente {
  background: oklch(0.90 0.08 200);
  color: oklch(0.30 0.12 200);
}

.badge--abandonado {
  background: oklch(0.90 0.05 25);
  color: oklch(0.38 0.14 25);
}

.badge--em_andamento {
  background: oklch(0.90 0.08 200);
  color: oklch(0.30 0.14 200);
}

.badge--concluido {
  background: oklch(0.90 0.08 145);
  color: oklch(0.30 0.12 145);
}

.badge--cancelado {
  background: oklch(0.90 0.05 25);
  color: oklch(0.38 0.14 25);
}

/* ── Order list ── */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: background 0.15s;
}

.order-item:hover {
  background: var(--card-hov);
}

.order-item__link {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}

.order-item__actions {
  display: flex;
  align-items: center;
  padding: 0 12px 0 0;
}

.order-item__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.order-item__desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-item__meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.order-item__value {
  font-weight: 600;
  color: var(--accent);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.empty-state--sm {
  padding: 24px;
}

.empty-state__icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--sidebar);
}

.empty-state__subtitle {
  font-size: 13px;
}

/* ── Detail view ── */
.detail-header {
  margin-bottom: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--accent);
}

.detail-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  max-width: 680px;
}

.detail-card__header {
  background: var(--sidebar);
  padding: 28px 28px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.detail-card__identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-card__name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.detail-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.detail-card__body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Info rows ── */
.info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
}

.info-row__icon {
  color: var(--accent);
  flex-shrink: 0;
}

.info-row__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.info-row__label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.info-row__value {
  font-size: 14px;
  color: var(--sidebar);
  font-weight: 500;
}

.info-row__value--highlight {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 16px;
}

/* ── WhatsApp button ── */
.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: #25D366;
  color: #fff;
  transition: background 0.15s;
  flex-shrink: 0;
}

.whatsapp-btn:hover {
  background: #128C7E;
  color: #fff;
}

.whatsapp-btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

/* ── Notes section ── */
.notes-section {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
}

.notes-section__label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.notes-section__text {
  font-size: 14px;
  color: var(--sidebar);
  line-height: 1.65;
}

/* ── Section divider ── */
.section-divider {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

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

.section-divider__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--sidebar);
}

/* ── Form card ── */
.form-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  max-width: 560px;
}

.form-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--sidebar);
  margin-bottom: 24px;
}

/* ── Form fields ── */
.client-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row--2col > * {
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.field__input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--sidebar);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

.field__input:focus {
  border-color: var(--accent);
}

.field__input--textarea {
  resize: vertical;
  min-height: 96px;
}

.field__input--select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Form errors ── */
.form-errors {
  background: var(--danger-lt);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-errors__item {
  font-size: 13px;
  color: var(--danger);
}

/* ── Form actions ── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* ── Devise views tweak ── */
.auth-wrap .field_with_errors { display: contents; }
.auth-wrap input[type=email],
.auth-wrap input[type=password],
.auth-wrap input[type=text] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: var(--card);
  color: var(--sidebar);
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.auth-wrap input[type=email]:focus,
.auth-wrap input[type=password]:focus,
.auth-wrap input[type=text]:focus { border-color: var(--accent); }
.auth-wrap h2 { font-size: 22px; font-weight: 700; color: var(--sidebar); margin-bottom: 20px; }
.auth-wrap label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.auth-wrap input[type=submit] {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}
.auth-wrap a { color: var(--accent); }
.auth-wrap p { font-size: 13px; margin-top: 8px; }
.auth-wrap .devise-form { background: var(--card); padding: 32px; border-radius: 18px; border: 1.5px solid var(--border); width: min(400px, 100%); }

.btn-google-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 16px;
}
.btn-google-oauth:hover { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Dashboard ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.dash-order-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.dash-order-card:hover {
  border-color: oklch(0.52 0.18 145 / 0.35);
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.dash-order-card__client {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-order-card__client-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s;
}

.dash-order-card__client-link:hover {
  color: var(--accent);
}

.dash-order-card__client-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-order-card__date {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.dash-order-card__date--overdue {
  background: var(--danger-lt);
  color: var(--danger);
}

.dash-order-card__date--today {
  background: oklch(0.92 0.10 80);
  color: oklch(0.40 0.16 80);
}

.dash-order-card__date--future {
  background: var(--accent-lt);
  color: var(--accent-dark);
}

.dash-order-card__desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar);
  line-height: 1.45;
  flex: 1;
}

.dash-order-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.dash-order-card__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.dash-order-card__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.btn--complete {
  background: var(--accent-lt);
  color: var(--accent-dark);
  border: none;
}

.btn--complete:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Admin ── */
.admin-table-wrap {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table thead th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border);
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.admin-table tbody tr:last-child { border-bottom: none; }

.admin-table tbody tr:hover { background: var(--card-hov); }

.admin-table tbody tr.admin-table__row--blocked { opacity: 0.6; }

.admin-table td { padding: 14px 16px; vertical-align: middle; }

.admin-table__name {
  font-weight: 600;
  color: var(--sidebar);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-table__email { color: var(--muted); }

.admin-table__date { color: var(--muted); font-size: 13px; }

.admin-table__actions { text-align: right; }

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.admin-badge--you {
  background: var(--accent-lt);
  color: var(--accent-dark);
}

.admin-badge--admin {
  background: oklch(0.92 0.07 280);
  color: oklch(0.38 0.14 280);
}

.admin-badge--user {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.admin-badge--active {
  background: var(--accent-lt);
  color: var(--accent-dark);
}

.admin-badge--blocked {
  background: var(--danger-lt);
  color: var(--danger);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── Plan picker ── */
.devise-form--wide {
  width: min(700px, 100%);
}

.devise-form__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.devise-form__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--sidebar);
}

.plan-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--card);
}

.plan-card:hover {
  border-color: oklch(0.52 0.18 145 / 0.5);
}

.plan-card:has(.plan-card__radio:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.52 0.18 145 / 0.12);
}

.plan-card--discontinued {
  opacity: 0.65;
}

.plan-card__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--sidebar);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.plan-card__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.plan-card__limit {
  font-size: 12px;
  color: var(--accent-dark);
  font-weight: 600;
  margin-top: 4px;
}

.plan-card__price {
  font-size: 14px;
  color: var(--sidebar);
  margin-top: 6px;
}

.plan-card__price strong {
  font-weight: 700;
  color: var(--accent);
}

.plan-card__price span {
  font-size: 11px;
  color: var(--muted);
}

/* ── Sidebar account link ── */
.sidebar__account-link {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 6px 4px;
  transition: background 0.15s;
  overflow: hidden;
  color: rgba(255,255,255,0.55);
}

.sidebar__account-link:hover {
  background: rgba(255,255,255,0.06);
}

.sidebar__user-plan {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Account settings ── */
.account-settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 720px;
}

.account-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.account-section__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.account-section__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.account-section__desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.account-section__body {
  padding: 24px;
}

.account-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-profile__name {
  font-size: 15px;
  font-weight: 600;
}

.account-profile__email {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.account-current-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--accent-lt);
  border: 1px solid oklch(0.80 0.10 145);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.account-current-plan__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
}

.account-current-plan__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.account-current-plan__meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.plan-change-form__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}

.btn--sm {
  padding: 6px 14px;
  font-size: 13px;
}

.form-actions--left {
  justify-content: flex-start;
}

/* ── Nav badge (alerts count in sidebar) ── */
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── Filter badge (count next to "Contato hoje" checkbox) ── */
.filter-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Client card with alert highlight ── */
.client-card--alert {
  border-color: oklch(0.52 0.18 145 / 0.4);
}

/* ── Alert indicator in client card ── */
.client-alert-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-lt);
  border-radius: 99px;
  padding: 1px 7px 1px 5px;
  width: fit-content;
}

/* ── Alert section in client show ── */
.alert-section {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.alert-active {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
}

.alert-active__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.alert-active__desc {
  font-size: 14px;
  color: var(--text);
}

.alert-active__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.alert-active__reason {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.alert-form__field--reason {
  flex: 1 1 200px;
}

.alert-form__optional {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.alert-today-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.alert-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.alert-form__recurrence {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-form__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── FAQ page ── */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 760px;
}

.faq-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.faq-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.faq-item {
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-item + .faq-item {
  margin-top: 6px;
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-item__question::-webkit-details-marker { display: none; }

.faq-item__question::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] .faq-item__question::after {
  transform: rotate(-135deg);
}

.faq-item__question:hover {
  background: var(--card-hov);
}

.faq-item[open] .faq-item__question {
  border-bottom: 1px solid var(--border);
}

.faq-item__answer {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.faq-item__answer p + p { margin-top: 8px; }

.faq-item__answer ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-item__answer li { color: var(--muted); }
.faq-item__answer strong { color: var(--text); font-weight: 600; }

/* ── Sidebar toggle button (hidden on desktop) ── */
.sidebar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.sidebar__toggle:hover { color: #fff; }

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9;
}
.sidebar-overlay--visible { display: block; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .app-shell { height: auto; overflow: visible; }
  .main-content { overflow-y: visible; }

  body { overflow-x: hidden; }

  /* prevent horizontal overflow */
  .page-header { flex-wrap: wrap; gap: 10px; }
  .page-header__right { flex-wrap: wrap; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-order-card { padding: 14px 16px; }
  .dash-order-card__desc { font-size: 13px; }
  .dash-order-card__footer { flex-wrap: wrap; }
  .search-bar__filter { flex-wrap: wrap; row-gap: 6px; }
  .filter-select { max-width: 100%; }

  .sidebar__toggle { display: flex; align-items: center; }

  /* Collapsed: sticky in-flow, 60px, icons only */
  .sidebar {
    width: 60px;
    padding: 16px 8px;
    position: sticky;
    top: 0;
    height: 100dvh;
    align-self: flex-start;
  }
  .sidebar__logo-text-muted,
  .sidebar__logo-text-accent,
  .sidebar__nav-item span,
  .sidebar__user,
  .sidebar__user-plan,
  .sidebar__logout-text,
  .sidebar__account-text { display: none; }
  .sidebar__logo-icon { display: none; }
  .sidebar__logo { justify-content: center; gap: 0; }
  .sidebar__toggle { margin-left: 0; }
  .sidebar__nav-item { justify-content: center; padding: 10px; }
  .sidebar__account-link { justify-content: center; }
  .sidebar__logout { justify-content: center; }

  .main-content { padding: 16px; }
  .form-row--2col { flex-direction: column; }
  .detail-card__actions { width: 100%; }

  /* Expanded: fixed overlay, full sidebar */
  .sidebar--expanded {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 220px;
    padding: 24px 12px;
    z-index: 10;
  }
  .sidebar--expanded .sidebar__logo-icon { display: flex; }
  .sidebar--expanded .sidebar__logo { justify-content: flex-start; gap: 10px; }
  .sidebar--expanded .sidebar__toggle { margin-left: auto; }
  .sidebar--expanded .sidebar__logo-text-muted,
  .sidebar--expanded .sidebar__logo-text-accent { display: block; }
  .sidebar--expanded .sidebar__nav-item span,
  .sidebar--expanded .sidebar__logout-text { display: inline; }
  .sidebar--expanded .sidebar__user,
  .sidebar--expanded .sidebar__user-plan { display: block; }
  .sidebar--expanded .sidebar__account-text { display: block; }
  .sidebar--expanded .sidebar__nav-item { justify-content: flex-start; padding: 10px 16px; }
  .sidebar--expanded .sidebar__account-link { justify-content: flex-start; }
  .sidebar--expanded .sidebar__logout { justify-content: flex-start; }
}
