/* ==========================================================
   LOOM — DESIGN SYSTEM — COMPONENTES E PÁGINAS (components.css)
   ========================================================== */

/* ===================== LOGIN SCREEN ===================== */
#login-screen {
  /* Force Light Mode variables for Login Area */
  --orange: #18181B;
  --orange-light: #27272A;
  --orange-dark: #09090B;
  --orange-faded: rgba(24,24,27,0.06);
  --bg: #EEF1F5;
  --bg2: #E4E8EE;
  --surface: #FFFFFF;
  --surface2: #F4F6FA;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --text: #1A1A2E;
  --text2: #4A5568;
  --text3: #8A94A6;
  --text-inv: #FFFFFF;

  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #f8f9fc 0%, #eef1f5 100%);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 52px 48px 44px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: fadeSlideUp 0.5s cubic-bezier(0.4,0,0.2,1) both;
  text-align: center;
  border: 1px solid var(--border);
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo-video {
  width: 100%;
  max-width: 220px;
  height: auto;
  margin-bottom: 20px;
  filter: grayscale(100%) contrast(1.45) brightness(1.15);
  mix-blend-mode: multiply;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.login-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--text3); text-transform: uppercase; text-align: left;
  margin-bottom: 8px;
}
.login-input {
  width: 100%; padding: 13px 16px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem;
  color: var(--text); transition: var(--transition);
  margin-bottom: 16px;
}
.login-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-faded); }
.login-input::placeholder { color: var(--text3); }
.login-btn {
  width: 100%; padding: 14px; background: var(--orange);
  color: var(--text-inv); font-size: 1rem; font-weight: 700;
  border-radius: var(--radius-sm); margin-top: 8px;
  transition: var(--transition); letter-spacing: 0.02em;
}
.login-btn:hover { background: var(--orange-light); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(232,93,4,0.35); }
.login-btn:active { transform: translateY(0); }
.login-footer { margin-top: 24px; font-size: 0.75rem; color: var(--text3); }

/* ===================== USER MENU DROPDOWN ===================== */
.user-menu {
  position: fixed; bottom: 80px; left: calc(var(--nav-w) + 8px); z-index: 500;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 280px; padding: 8px; display: none;
  animation: fadeSlideUp 0.2s ease both;
}
.user-menu.open { display: block; }
.user-menu-header {
  padding: 12px 14px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.user-menu-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.user-menu-sub { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; cursor: pointer;
  font-size: 0.875rem; font-weight: 500; color: var(--text2);
  transition: var(--transition);
}
.user-menu-item:hover { background: var(--surface2); color: var(--text); }
.user-menu-item svg { width: 18px; height: 18px; color: var(--text3); }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger:hover { background: var(--red-faded); }
.user-menu-item.danger svg { color: var(--red); }
.user-menu-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ===================== PAGE HEADER ===================== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }

/* ===================== BUTTONS ===================== */
.btn-primary {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px; background: var(--orange); color: var(--text-inv);
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 700;
  transition: var(--transition); border: none;
}
.btn-primary:hover { background: var(--orange-light); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(232,93,4,0.35); }
.btn-primary:active { transform: none; }
.btn-secondary {
  padding: 10px 18px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); border-radius: var(--radius-sm); font-size: 0.875rem;
  font-weight: 600; transition: var(--transition); cursor: pointer;
}
.btn-secondary:hover { background: var(--surface2); color: var(--text); }
.btn-ghost {
  padding: 8px 14px; background: transparent; border: none;
  color: var(--text2); border-radius: var(--radius-sm); font-size: 0.875rem;
  font-weight: 600; transition: var(--transition); cursor: pointer;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-tab {
  background: transparent;
  color: var(--text3);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-tab.active {
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .btn-tab.active {
  background: var(--surface2) !important;
  color: var(--text) !important;
}

/* ===================== CARDS ===================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}

/* ===================== DASHBOARD / STATS ===================== */
.meta-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.meta-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 6px; }
.meta-progress { height: 10px; background: var(--bg2); border-radius: 10px; margin-top: 10px; overflow: hidden; }
.meta-bar { height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-light)); border-radius: 10px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.meta-pct { font-size: 2rem; font-weight: 900; color: var(--orange); }
.meta-row { display: flex; align-items: center; justify-content: space-between; }
.meta-goal { font-size: 0.8rem; background: var(--green-faded); color: var(--green); padding: 4px 10px; border-radius: 20px; font-weight: 600; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition);
  cursor: pointer;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 6px; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.04em; }
.stat-bg {
  position: absolute; right: -10px; bottom: -10px;
  width: 70px; height: 70px; border-radius: 50%;
  opacity: 0.3;
}

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.section-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 14px; }
.session-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface2); margin-bottom: 8px; transition: var(--transition);
}
.session-item:hover { background: var(--bg2); }
.session-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: var(--text-inv); font-size: 0.75rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.session-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.session-info { font-size: 0.75rem; color: var(--text3); }
.session-meta { margin-left: auto; text-align: right; }
.session-val { font-size: 0.875rem; font-weight: 700; color: var(--green); }
.session-date { font-size: 0.7rem; color: var(--text3); }

/* ===================== EMPTY STATE ===================== */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; color: var(--text3);
}
.empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty p { font-size: 0.9rem; }

/* ===================== CLIENTS PAGE ===================== */
.search-bar {
  width: 280px; max-width: 100%; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 30px; font-size: 0.875rem; color: var(--text);
  transition: var(--transition); margin-bottom: 16px;
}
.search-bar:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-faded); }
.search-bar::placeholder { color: var(--text3); }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; box-shadow: var(--shadow); }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
thead th {
  padding: 14px 16px; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3);
  background: var(--surface2); text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 13px 16px; font-size: 0.875rem; color: var(--text); }
.client-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: var(--text-inv); font-size: 0.7rem;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  margin-right: 8px; flex-shrink: 0;
}
.client-cell { display: flex; align-items: center; }

/* ===================== BADGES & PILLS ===================== */
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 20px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.badge-orange { background: var(--orange-faded); color: var(--orange); }
.badge-blue { background: var(--blue-faded); color: var(--blue); }
.badge-green { background: var(--green-faded); color: var(--green); }
.badge-amber { background: var(--amber-faded); color: var(--amber); }
.badge-red { background: var(--red-faded); color: var(--red); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; font-size: 0.72rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.pill-agendado { background: var(--blue-faded); color: var(--blue); }
.pill-concluido { background: var(--green-faded); color: var(--green); }
.pill-cancelado { background: var(--red-faded); color: var(--red); }
.pill-pendente { background: var(--amber-faded); color: var(--amber); }

.action-btn {
  width: 32px; height: 32px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; transition: var(--transition); border: none;
}
.action-btn svg { width: 15px; height: 15px; }
.action-edit { background: var(--amber-faded); color: var(--amber); }
.action-edit:hover { background: var(--amber); color: white; }
.action-del { background: var(--red-faded); color: var(--red); }
.action-del:hover { background: var(--red); color: white; }
.action-gap { display: flex; gap: 6px; }

/* ===================== AGENDA ===================== */
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-bottom: 20px; }
.calendar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); min-height: 326px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month { font-size: 1rem; font-weight: 700; color: var(--text); }
.cal-nav { width: 30px; height: 30px; border-radius: 8px; background: var(--surface2); border: none; color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.cal-nav:hover { background: var(--orange-faded); color: var(--orange); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 38px)); justify-content: center; gap: 3px; }
.cal-dow { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text3); text-align: center; padding: 4px 0; }
.cal-day {
  height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: var(--transition); color: var(--text); position: relative;
}
.cal-day:hover:not(.cal-empty) { background: var(--orange-faded); color: var(--orange); }
.cal-day.today { background: var(--orange); color: var(--text-inv); font-weight: 700; }
.cal-day.selected { background: var(--orange-faded); color: var(--orange); border: 2px solid var(--orange); font-weight: 700; }
.cal-day.has-event::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--orange);
}
.cal-day.today.has-event::after { background: var(--text-inv); }
.cal-empty { pointer-events: none; }

.sessions-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); min-height: 326px; display: flex; flex-direction: column; }
.sessions-side-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 12px; }
#sessions-side-content { flex: 1; overflow-y: auto; padding-right: 2px; }
.session-card {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface2); margin-bottom: 8px; transition: var(--transition);
  border-left: 3px solid var(--orange);
}
.session-card:hover { background: var(--bg2); }
.session-card-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.session-card-info { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }
.session-card-val { font-size: 0.85rem; font-weight: 700; color: var(--green); margin-top: 4px; }
.agenda-table-scroll { max-height: 250px; overflow-y: auto; }

/* ===================== ESTOQUE ===================== */
.estoque-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
/* LOOM 17/09/2026 — o Patrimônio tem três números, não dois: valor, depreciação
   e o rateio por atendimento. Com a grade de duas colunas o terceiro caía
   sozinho na linha de baixo, ocupando meia tela à toa. */
.estoque-stats.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .estoque-stats.tres { grid-template-columns: minmax(0, 1fr); } }
.estoque-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 20px; box-shadow: var(--shadow);
}
.estoque-stat-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 6px; }
.estoque-stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text); }

/* ===================== FINANCEIRO ===================== */
.fin-period-btns { display: flex; gap: 6px; }
.period-btn {
  padding: 8px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: var(--transition); background: var(--surface2);
  border: 1px solid var(--border); color: var(--text2);
}
.period-btn.active { background: var(--orange); color: var(--text-inv); border-color: var(--orange); }
.fin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.fin-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow);
}
.fin-stat-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 6px; }
.fin-stat-value { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -0.04em; }
.fin-stat-sub { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }
.fin-stat-border-green { border-top: 3px solid var(--green); }
.fin-stat-border-orange { border-top: 3px solid var(--orange); }
.fin-stat-border-red { border-top: 3px solid var(--red); }

.fin-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
.fin-period-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); height: 326px; display: flex; flex-direction: column; overflow-y: auto; }
.fin-period-item { padding: 12px; border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface2); }
.fin-period-month { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text3); margin-bottom: 8px; }
.fin-row { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; color: var(--text2); }
.fin-val-green { color: var(--green); font-weight: 700; }
.fin-val-red { color: var(--red); font-weight: 700; }
.fin-val-bold { color: var(--text); font-weight: 800; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); height: 326px; display: flex; flex-direction: column; position: relative; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.chart-type-btns { display: flex; gap: 4px; }
.chart-type-btn {
  padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  background: var(--surface2); border: none; color: var(--text2); cursor: pointer;
  transition: var(--transition); display: flex; align-items: center; gap: 4px;
}
.chart-type-btn.active { background: var(--orange); color: var(--text-inv); }
.chart-type-btn svg { width: 14px; height: 14px; }

/* ===================== MODALS ===================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px 28px 24px; width: 100%; max-width: 500px;
  box-shadow: var(--shadow-lg); animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1) both;
  max-height: 90vh; overflow-y: auto; position: relative;
  border: 1px solid var(--border);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; background: var(--surface2);
  border: none; color: var(--text3); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: var(--red-faded); color: var(--red); }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text3); margin-bottom: 7px; display: block; }
.form-input, .form-select {
  width: 100%; padding: 12px 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text);
  transition: var(--transition);
}
.form-input:focus, .form-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-faded); }
.form-input::placeholder { color: var(--text3); }
.form-select { cursor: pointer; }
.preview-box {
  background: var(--orange-faded); border-radius: var(--radius-sm);
  padding: 14px; margin-top: 4px;
}
.preview-title { font-size: 0.7rem; font-weight: 700; color: var(--orange); margin-bottom: 8px; }
.preview-row { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text2); margin-bottom: 4px; }
.preview-val { font-weight: 700; color: var(--text); }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ===================== SETTINGS MODAL ===================== */
.settings-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: var(--transition);
  margin-bottom: 4px;
}
.settings-tab:hover { background: var(--surface2); color: var(--text); }
.settings-tab.active { background: var(--surface) !important; color: var(--text) !important; font-weight: 700; box-shadow: var(--shadow); }
[data-theme="dark"] .settings-tab.active { background: var(--surface2) !important; }
.settings-panel-content { display: none; }

/* ===================== TOAST ===================== */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease both;
  display: flex; align-items: center; gap: 10px; max-width: 320px;
  border: 1px solid var(--border);
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast-success { background: var(--green-faded); color: var(--green); border-color: var(--green); }
.toast-error { background: var(--red-faded); color: var(--red); border-color: var(--red); }
.toast-info { background: var(--blue-faded); color: var(--blue); border-color: var(--blue); }

/* ===================== CLIENT SEARCH DROPDOWN ===================== */
.client-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  animation: fadeSlideDown 0.15s ease both;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.client-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.client-search-item:last-child { border-bottom: none; }
.client-search-item:hover {
  background: var(--surface2);
}
.client-search-item svg {
  flex-shrink: 0;
  opacity: 0.5;
}



/* ===== TABELAS VIRAM CARDS NO CELULAR ===== */
@media (max-width: 760px) {
  .table-wrap { overflow-x: visible; background: transparent; border: none; box-shadow: none; border-radius: 0; }
  .table-wrap table { min-width: 0; width: 100%; display: block; border-collapse: separate; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; width: 100%; }
  .table-wrap tbody tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 12px; }
  .table-wrap tbody td { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: auto; border: none; padding: 8px 0; text-align: right; white-space: normal; }
  .table-wrap tbody td::before { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); text-align: left; flex-shrink: 0; }
  .table-wrap tbody td[colspan] { display: block; text-align: center; padding: 24px 0; }
  .table-wrap tbody td[colspan]::before { content: none; }
  #clients-tbody td:nth-child(1)::before { content: 'Cliente'; }
  #clients-tbody td:nth-child(2)::before { content: 'Telefone'; }
  #clients-tbody td:nth-child(3)::before { content: 'Tipo'; }
  #clients-tbody td:nth-child(4)::before { content: 'Valor da sessão'; }
  #clients-tbody td:nth-child(5)::before { content: 'Data'; }
  #clients-tbody td:nth-child(6)::before { content: 'Status'; }
  #clients-tbody td:nth-child(7)::before { content: 'Ações'; }
  #agenda-tbody td:nth-child(1)::before { content: 'Cliente'; }
  #agenda-tbody td:nth-child(2)::before { content: 'Data'; }
  #agenda-tbody td:nth-child(3)::before { content: 'Horário'; }
  #agenda-tbody td:nth-child(4)::before { content: 'Tipo'; }
  #agenda-tbody td:nth-child(5)::before { content: 'Valor'; }
  #agenda-tbody td:nth-child(6)::before { content: 'Status'; }
  #agenda-tbody td:nth-child(7)::before { content: 'Ações'; }
  #estoque-tbody td:nth-child(1)::before { content: 'Material'; }
  #estoque-tbody td:nth-child(2)::before { content: 'Qtd (Min)'; }
  #estoque-tbody td:nth-child(3)::before { content: 'Valor Total'; }
  #estoque-tbody td:nth-child(4)::before { content: 'Valor Unit.'; }
  #estoque-tbody td:nth-child(5)::before { content: 'Categoria'; }
  #estoque-tbody td:nth-child(6)::before { content: 'Validade'; }
  #estoque-tbody td:nth-child(7)::before { content: 'Alertas'; }
  #estoque-tbody td:nth-child(8)::before { content: 'Ações'; }
}

/* ===== LOOM 24/08/2026 - modo somente-leitura ==========================
   Quando o teste grátis termina ou há pendência de pagamento, tudo que grava
   fica visivelmente indisponível. A pessoa vê antes de clicar, em vez de
   preencher um formulário inteiro e só então receber um erro. O clique
   continua funcionando de propósito: ele dispara a explicação do que fazer. */
body.modo-somente-leitura [data-requer-edicao],
.acao-bloqueada {
  opacity: 0.45;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

body.modo-somente-leitura [data-requer-edicao]:hover,
.acao-bloqueada:hover {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

/* Em telas de toque não existe hover, então o cadeado ajuda a ler o estado. */
body.modo-somente-leitura .btn-primary[data-requer-edicao]::after {
  content: " 🔒";
  font-size: 0.9em;
}

/* LOOM 01/09/2026 — linha do mês anterior no cartão da meta.
   Aparece só quando o mês novo ainda não teve sessão concluída, para o
   trabalho do mês que fechou não sumir da tela sem explicação. */
.meta-anterior {
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text3);
}


/* LOOM 03/09/2026 — vinha de um bloco <style> dentro do app.html. */
  .login-legal{margin:12px 0 0;font-size:.74rem;line-height:1.55;text-align:center;color:#8a8f9c}
  .login-legal a{color:#5b6070;text-decoration:underline}
  .login-footer a{color:inherit;text-decoration:underline}

/* LOOM 12/09/2026 — alvos de toque no celular.
   A auditoria de 12/09 mediu, na tela de 390px, botoes de 30 a 32px de largura
   e pilulas de status com 15 a 22px de altura. O dedo medio cobre cerca de
   45px: abaixo de 44 o erro de clique deixa de ser exceao. Nada disso muda no
   computador — as regras valem so quando a tela e de celular ou tablet e o
   apontador e grosso (dedo), nunca mouse. */
@media (max-width: 760px) and (pointer: coarse) {
  .action-btn { width: 44px; height: 44px; }
  .action-btn svg { width: 17px; height: 17px; }
  .action-gap { gap: 10px; }

  .cal-nav { width: 44px; height: 44px; }

  /* So a pilula que realmente responde ao toque cresce. As decorativas, dentro
     dos cartoes de sessao, continuam do tamanho de etiqueta que sempre foram. */
  .status-pill[data-loom-acao] { min-height: 44px; padding: 10px 16px; }
}
