/* ==========================================================================
   MIC360 · Avaliação Holística — Design System
   Paleta: off-white #FAF7F2 · violeta #5B3E96 · dourado #C9A227
   Verde-sálvia #7FA98F · texto #2E2A38 · gradiente violeta→índigo
   ========================================================================== */

:root {
  /* Cores de marca */
  --bg: #FAF7F2;
  --bg-alt: #F1ECE2;
  --surface: #FFFFFF;
  --primary: #5B3E96;
  --primary-dark: #46306F;
  --primary-light: #8A6BC4;
  --indigo: #4338CA;
  --secondary: #C9A227;
  --secondary-light: #E4C766;
  --support: #7FA98F;
  --support-dark: #5E8A73;
  --text: #2E2A38;
  --text-muted: #6B6478;
  --text-soft: #948CA3;
  --border: #E4DDCF;
  --border-soft: #ECE6D9;
  --danger: #C0392B;
  --danger-light: #FBE7E4;
  --success: #3F8F5F;
  --success-light: #E5F4EA;
  --warning: #C9A227;
  --warning-light: #FBF2D9;
  --info: #3B6FA0;
  --info-light: #E4EEF7;

  --gradient-brand: linear-gradient(135deg, #5B3E96 0%, #4338CA 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(91,62,150,.10) 0%, rgba(67,56,202,.10) 100%);

  --font: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(46, 42, 56, .08);
  --shadow: 0 4px 16px rgba(46, 42, 56, .10);
  --shadow-lg: 0 12px 32px rgba(46, 42, 56, .16);

  --sidebar-w: 264px;
  --header-h: 64px;
  --footer-h: 40px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4, h5 { font-weight: 600; margin: 0 0 .5em; color: var(--text); }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
ul { padding-left: 1.2em; }
::selection { background: var(--primary-light); color: #fff; }

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.w-full { width: 100%; }

/* ==========================================================================
   App shell
   ========================================================================== */
#app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.app-body { display: flex; flex: 1; min-height: calc(100vh - var(--footer-h)); }

.sidebar {
  width: var(--sidebar-w);
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.sidebar-brand .logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
  border: 1px solid rgba(255,255,255,.35);
}
.sidebar-brand .brand-name { font-weight: 600; font-size: 16px; line-height: 1.15; }
.sidebar-brand .brand-tag { font-size: 11px; opacity: .78; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.sidebar-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  opacity: .62; padding: 16px 12px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 1px 0; border-radius: 10px;
  color: rgba(255,255,255,.86); font-size: 14px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.sidebar-link .ic { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.sidebar-link:hover { background: rgba(255,255,255,.10); text-decoration: none; color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.20); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.14); font-size: 12px; opacity: .8; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.app-header .header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-header h1 { font-size: 18px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger {
  display: none; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 18px; color: var(--primary); align-items: center; justify-content: center;
}
.header-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
}
.header-user-name { font-size: 13px; font-weight: 600; }
.header-user-role { font-size: 11px; color: var(--text-muted); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }

main#view { flex: 1; padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

.app-footer {
  height: var(--footer-h);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-soft);
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(46,42,56,.45); z-index: 30;
}

/* Rotas públicas (login/registro): esconde toda a "casca" do app */
#app-shell.no-chrome .sidebar,
#app-shell.no-chrome .app-header,
#app-shell.no-chrome .app-footer,
#app-shell.no-chrome .sidebar-backdrop { display: none; }
#app-shell.no-chrome .app-body { min-height: 100vh; }
#app-shell.no-chrome main#view { padding: 0; max-width: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  white-space: nowrap; line-height: 1.2;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-gold { background: var(--secondary); color: #2E2A38; }
.btn-gold:hover:not(:disabled) { background: var(--secondary-light); }
.btn-support { background: var(--support); color: #fff; }
.btn-support:hover:not(:disabled) { background: var(--support-dark); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--gradient-brand-soft); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-alt); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #9C2E22; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px 10px; }

/* ==========================================================================
   Cards & layout blocks
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-title-row h2, .card-title-row h3 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.metric-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden;
}
.metric-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient-brand);
}
.metric-card .metric-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.metric-card .metric-value { font-size: 30px; font-weight: 700; color: var(--primary); }
.metric-card .metric-sub { font-size: 12.5px; color: var(--text-soft); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }
.section-title h2 { font-size: 17px; margin: 0; }
.section-title .line { flex: 1; height: 1px; background: var(--border); }

.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); margin: 0; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

.disclaimer {
  font-size: 12.5px; color: var(--text-muted); background: var(--bg-alt);
  border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 16px; }
.field label, .field-label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
.field-hint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="tel"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(91,62,150,.14);
}
textarea { resize: vertical; min-height: 84px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 20px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.checkbox-row, .radio-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer;
  background: var(--surface); user-select: none; transition: all .15s ease;
}
.check-pill input { display: none; }
.check-pill.checked { background: var(--gradient-brand-soft); border-color: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.range-field { display: flex; align-items: center; gap: 12px; }
.range-field input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-value {
  min-width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}

.select-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 700px) { .select-cards { grid-template-columns: 1fr 1fr; } }
.select-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  cursor: pointer; text-align: center; background: var(--surface); transition: all .15s ease;
}
.select-card:hover { border-color: var(--primary-light); }
.select-card.selected { border-color: var(--primary); background: var(--gradient-brand-soft); box-shadow: 0 0 0 3px rgba(91,62,150,.10); }
.select-card .sc-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.select-card .sc-desc { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13.5px; }
table.table th {
  text-align: left; padding: 12px 16px; background: var(--bg-alt); color: var(--text-muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border-soft);
}
table.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tr.row-click { cursor: pointer; }
table.table tr.row-click:hover td { background: var(--bg-alt); }

/* ==========================================================================
   Chips (por frequência / status / tags)
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border-soft);
}
.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chip-freq { color: #fff; border: none; }
.chip-status-agendada { background: var(--info-light); color: var(--info); }
.chip-status-em_andamento { background: var(--warning-light); color: #8a6c14; }
.chip-status-concluida { background: var(--success-light); color: var(--success); }
.chip-status-ativa { background: var(--info-light); color: var(--info); }
.chip-status-concluida2 { background: var(--success-light); color: var(--success); }
.chip-status-cancelada { background: var(--danger-light); color: var(--danger); }
.chip-sm { padding: 2px 9px; font-size: 11px; }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(46,42,56,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: popIn .18s ease;
}
.modal.modal-lg { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 22px 22px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-soft); line-height: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
  padding: 13px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px; background: var(--text); color: #fff;
  animation: slideIn .2s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Progress bar
   ========================================================================== */
.progress { height: 9px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; border: 1px solid var(--border-soft); }
.progress-bar { height: 100%; background: var(--gradient-brand); border-radius: 99px; transition: width .3s ease; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-label { font-size: 12.5px; font-weight: 700; color: var(--primary); min-width: 38px; text-align: right; }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
  padding: 10px 16px; border: none; background: none; cursor: pointer; font-size: 13.5px;
  font-weight: 600; color: var(--text-muted); border-bottom: 2.5px solid transparent; white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .15s ease; }

/* ==========================================================================
   Accordion
   ========================================================================== */
.accordion-item { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.accordion-header {
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-weight: 600; font-size: 14px; background: var(--bg-alt);
}
.accordion-header .acc-arrow { transition: transform .2s ease; color: var(--text-muted); }
.accordion-item.open .acc-arrow { transform: rotate(180deg); }
.accordion-body { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.accordion-item.open .accordion-body { max-height: 4000px; padding: 14px 16px; }

/* ==========================================================================
   Stepper (roteiro / protocolo)
   ========================================================================== */
.stepper { position: relative; padding-left: 6px; }
.step {
  position: relative; padding: 0 0 26px 34px; border-left: 2px solid var(--border);
  margin-left: 10px;
}
.step:last-child { border-color: transparent; padding-bottom: 4px; }
.step-marker {
  position: absolute; left: -13px; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-muted);
}
.step.done .step-marker { background: var(--support); border-color: var(--support); color: #fff; }
.step.current .step-marker { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(91,62,150,.16); }
.step-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.step-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.step-title-row h4 { margin: 0; font-size: 14.5px; }
.step-time { font-size: 11.5px; color: var(--secondary); font-weight: 700; background: var(--warning-light); padding: 2px 9px; border-radius: 999px; }
.step-quote {
  border-left: 3px solid var(--primary-light); background: var(--gradient-brand-soft); padding: 10px 14px;
  border-radius: 0 8px 8px 0; font-style: italic; color: var(--primary-dark); font-size: 13.5px; margin: 8px 0;
}
.step-meta-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin: 10px 0 4px; }

/* ==========================================================================
   Timeline (evolução / histórico)
   ========================================================================== */
.timeline { position: relative; margin-left: 8px; }
.timeline-item { position: relative; padding: 0 0 22px 28px; border-left: 2px solid var(--border-soft); }
.timeline-item:last-child { border-color: transparent; }
.timeline-dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-date { font-size: 12px; color: var(--text-soft); font-weight: 600; }

/* ==========================================================================
   Escala Vibracional — escada de frequências
   ========================================================================== */
.scale-ladder { display: flex; flex-direction: column; gap: 6px; }
.scale-step {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 12px;
  color: #fff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
}
.scale-step:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.scale-step .sf-hz { font-size: 18px; font-weight: 700; min-width: 58px; }
.scale-step .sf-name { font-weight: 600; font-size: 15px; flex: 1; }
.scale-step .sf-arrow { opacity: .8; }
.scale-divider {
  display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--text-soft);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.scale-divider::before, .scale-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.freq-hero { border-radius: var(--radius-lg); padding: 28px; color: #fff; margin-bottom: 20px; box-shadow: var(--shadow); }
.freq-hero .fh-hz { font-size: 40px; font-weight: 700; line-height: 1; }
.freq-hero .fh-name { font-size: 20px; font-weight: 600; opacity: .95; }
.freq-hero .fh-badge { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.22); padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.freq-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 800px) { .freq-detail-grid { grid-template-columns: 1fr; } }
.kw-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Barras horizontais de distribuição (dashboard) */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .bar-label { min-width: 118px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.bar-row .bar-track { flex: 1; height: 16px; background: var(--bg-alt); border-radius: 8px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 8px; transition: width .4s ease; }
.bar-row .bar-count { min-width: 22px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--text); }

/* ==========================================================================
   Cartas vibracionais — flip card
   ========================================================================== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.flip-card { perspective: 1200px; height: 210px; cursor: pointer; }
.flip-card-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.4,.2,.2,1); transform-style: preserve-3d; }
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.flip-card-front {
  background: var(--gradient-brand);
  border: 3px solid var(--secondary);
  color: #fff;
}
.flip-card-front .fc-glyph { font-size: 34px; margin-bottom: 8px; opacity: .9; }
.flip-card-front .fc-back-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.flip-card-back {
  transform: rotateY(180deg); border: 3px solid var(--secondary); color: #fff;
  overflow-y: auto; justify-content: flex-start;
}
.flip-card-back .fc-hz { font-size: 22px; font-weight: 700; }
.flip-card-back .fc-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; }

.card-full {
  border: 3px solid var(--secondary); border-radius: var(--radius-lg); padding: 26px; color: #fff;
  box-shadow: var(--shadow-lg);
}
.card-full .cf-hz { font-size: 15px; opacity: .85; font-weight: 700; letter-spacing: .05em; }
.card-full .cf-name { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.card-full .cf-message { font-size: 16px; line-height: 1.6; font-style: italic; margin-bottom: 16px; }
.card-full .cf-questions { background: rgba(255,255,255,.14); border-radius: 12px; padding: 14px 18px; }
.card-full .cf-questions li { margin-bottom: 6px; }

/* ==========================================================================
   Exercícios / recursos cards
   ========================================================================== */
.resource-card { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.resource-card .rc-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 8px; }
.rc-kind-mental { background: var(--info-light); color: var(--info); }
.rc-kind-emocional { background: #F7E4F1; color: #9B3F82; }
.rc-kind-pratica { background: var(--success-light); color: var(--success); }

/* ==========================================================================
   Login / Auth
   ========================================================================== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); padding: 24px; position: relative; overflow: hidden;
}
.auth-page::before, .auth-page::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08);
}
.auth-page::before { width: 420px; height: 420px; top: -120px; left: -120px; }
.auth-page::after { width: 320px; height: 320px; bottom: -100px; right: -80px; }
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 34px 32px; position: relative; z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 6px; }
.auth-logo .logo-mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--gradient-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px;
  margin: 0 auto 12px; box-shadow: var(--shadow);
}
.auth-logo h1 { font-size: 20px; margin-bottom: 2px; }
.auth-logo .auth-tagline { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; text-align: center; }
.auth-tabs { display: flex; background: var(--bg-alt); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--text-muted); }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-error { background: var(--danger-light); color: var(--danger); padding: 10px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; }
.auth-page .disclaimer { margin-top: 18px; }

/* ==========================================================================
   Estados vazios / skeleton
   ========================================================================== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .es-icon { font-size: 40px; margin-bottom: 12px; opacity: .6; }
.empty-state h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; margin-bottom: 16px; }

.skel { background: linear-gradient(90deg, var(--bg-alt) 25%, #EAE3D4 37%, var(--bg-alt) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 8px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-card { height: 90px; border-radius: var(--radius); }

/* ==========================================================================
   Search / toolbar
   ========================================================================== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box input { padding-left: 34px; }
.search-box .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 13px; }

/* ==========================================================================
   Jornada 8 semanas
   ========================================================================== */
.week-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .week-grid { grid-template-columns: repeat(2, 1fr); } }
.week-card {
  border: 1.5px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; cursor: pointer;
  background: var(--surface); transition: all .15s ease;
}
.week-card:hover { border-color: var(--primary-light); }
.week-card.current { border-color: var(--primary); background: var(--gradient-brand-soft); }
.week-card.done { opacity: .75; }
.week-card .wk-num { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.week-card .wk-title { font-weight: 600; font-size: 13.5px; margin-top: 4px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.task-row:last-child { border-bottom: none; }
.task-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.task-row.checked span { text-decoration: line-through; color: var(--text-soft); }

/* Blindagem / self-care */
.moment-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.moment-antes { background: var(--info-light); color: var(--info); }
.moment-depois { background: #F7E4F1; color: #9B3F82; }
.moment-rotina { background: var(--success-light); color: var(--success); }

/* Cura sonora layout */
.sound-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .sound-layout { grid-template-columns: 1fr; } }
.sound-index { position: sticky; top: 84px; }
.sound-index-item {
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; cursor: pointer; color: var(--text-muted);
}
.sound-index-item:hover { background: var(--bg-alt); }
.sound-index-item.active { background: var(--gradient-brand-soft); color: var(--primary); font-weight: 600; }

/* Mudra icon placeholder */
.mudra-box { display: flex; align-items: center; gap: 10px; background: var(--bg-alt); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; }

/* ==========================================================================
   Responsive: sidebar becomes drawer < 900px
   ========================================================================== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .hamburger { display: flex; }
  main#view { padding: 16px; }
  .app-header { padding: 0 14px; }
  .select-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .auth-card { padding: 26px 20px; }
  .modal-body, .modal-header { padding-left: 16px; padding-right: 16px; }
}

/* Print-ish quote block used across method/protocols */
.quote-block { border-left: 3px solid var(--secondary); background: var(--warning-light); padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: 13.5px; }
