/* ============================================================
   ToFazendo — Design System
   Clean, pastel, card-based UI for desktop + tablet + mobile
   ============================================================ */

/* Visually hidden but accessible/functional */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Palette — soft pastels + readable text --- */
:root {
  --bg: #f0f4fb;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-light: #eef2ff;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --accent-pink: #f9a8d4;
  --accent-lavender: #c4b5fd;
  --accent-mint: #6ee7b7;
  --accent-sky: #7dd3fc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT SHELL — sidebar fixed + content margin-left
   ============================================================ */
.app-shell {
  min-height: 100vh;
}

/* --- Sidebar (fixed left) --- */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 260px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.sidebar-top {
  flex: 1;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 28px;
  letter-spacing: -0.5px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.sidebar-brand-row .brand {
  margin-bottom: 0;
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-logout-btn {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  min-height: auto;
  padding: 6px 10px;
  font-size: 0.9rem !important;
  color: var(--muted);
}

.brand-bang {
  display: inline-block;
  transform: rotate(12deg);
  background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 1.65rem;
  margin-left: 1px;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, .45));
  text-shadow: none;
}

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

.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: all .15s ease;
}

.menu a:hover,
.menu a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.menu-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

/* --- Sidebar footer / user profile --- */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
  position: relative;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.user-profile:hover {
  background: var(--primary-light);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-lavender), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}

.user-email {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}

.profile-arrow {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all .2s;
  display: flex;
  align-items: center;
}

.profile-arrow:hover {
  background: var(--border);
  color: var(--primary);
  opacity: 1;
}

/* --- Dropdown --- */
.profile-dropdown {
  display: none;
  position: absolute;
  bottom: 70px;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.profile-dropdown.active {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background .15s;
  font-family: inherit;
}

.dropdown-item:hover {
  background: var(--primary-light);
}

.dropdown-item.danger {
  color: var(--danger);
  border-top: 1px solid var(--border);
}

.dropdown-item.danger:hover {
  background: var(--danger-light);
}

/* --- Content area (pushed right of fixed sidebar) --- */
.content {
  margin-left: 260px;
  padding: calc(28px + env(safe-area-inset-top)) 32px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ============================================================
   AUTH PAGES — no sidebar, centered layout
   ============================================================ */
.auth-body {
  background: linear-gradient(135deg, #eef2ff 0%, #f0f4fb 40%, #fdf2f8 100%);
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.login-logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.login-logo .brand-bang {
  font-size: 2.2rem;
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 2px;
}

/* ============================================================
   PAGE HEADER + FILTERS
   ============================================================ */
.page-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.page-header .page-title {
  flex: 1;
  min-width: auto;
}

.page-header > .btn,
.page-header > a.btn {
  margin-left: auto;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex: 1;
  justify-content: flex-end;
}

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

.header-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}

.header-form-compact .form-select,
.header-form-compact input,
.header-form-compact select {
  width: auto;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.period-selector {
  display: inline-flex;
  gap: 0;
  background: #eef2ff;
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--border);
}

.period-btn {
  background: transparent;
  border: none;
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  white-space: nowrap;
}

.period-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

.period-btn:hover:not(.active) {
  color: var(--primary);
  background: rgba(99, 102, 241, .08);
}

/* ============================================================
   CARDS + KPIs
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card h2, .card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

/* Colored KPI cards (accent left border) */
.card.kpi-card-1 { border-left: 4px solid var(--accent-lavender); }
.card.kpi-card-2 { border-left: 4px solid var(--accent-sky); }
.card.kpi-card-3 { border-left: 4px solid var(--accent-mint); }
.card.kpi-card-4 { border-left: 4px solid var(--accent-pink); }

.dashboard-kpi-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dashboard-kpi-link:hover {
  text-decoration: none;
}

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 0.88rem;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn, button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s;
  white-space: nowrap;
}

.btn:hover, button:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  opacity: 1;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: #1e293b;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #cbd5e1;
  opacity: 1;
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: #e2e8f0;
  opacity: 1;
}

.link-danger {
  color: var(--danger);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.th-actions,
.td-actions {
  text-align: right;
}

.td-actions .actions {
  justify-content: flex-end;
}

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

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
}

.form-centered {
  margin: 0 auto;
}

.form-title-spaced {
  margin: 0 0 20px;
  font-size: 1.55rem;
  color: var(--text);
}

.form-card .actions {
  justify-content: flex-end;
}

.form-card .actions.actions-split {
  justify-content: space-between;
  width: 100%;
  flex-wrap: nowrap;
}

.actions-split .actions-left,
.actions-split .actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions-split .actions-right {
  margin-left: auto;
}

.child-actions-row {
  margin-top: 16px;
}



.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.35fr);
  gap: 12px;
}

.inline-fields-3 {
  display: grid;
  grid-template-columns: minmax(80px, 0.2fr) minmax(0, 1fr) minmax(140px, 0.32fr);
  gap: 12px;
}

.inline-fields-4 {
  display: grid;
  gap: 12px;
}

.inline-fields-compact {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(140px, 0.45fr);
  gap: 12px;
}

.field-slim input,
.field-slim select {
  max-width: 110px;
}

.field-description-compact textarea {
  min-height: 74px;
  max-height: 96px;
}

.field-description-3lines textarea {
  min-height: 72px;
  max-height: 72px;
  resize: none;
}

.task-config-section {
  margin-bottom: 12px;
}

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

.routine-block {
  display: grid;
  gap: 6px;
}

.routine-block label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.routine-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.routine-inputs input[type="time"] {
  padding-left: 10px;
  padding-right: 10px;
}

.weekday-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-pill {
  position: relative;
  margin: 0;
  flex: 1 1 calc(25% - 8px);
}

.weekday-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  background: #eef2ff;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.weekday-pill input:checked + span {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

.task-weekdays-grid {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}

.task-weekdays-row {
  display: contents;
}

.recorrencia-dia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
}

.recorrencia-dia.ativo {
  background: #1976d2;
  color: #fff;
  border-color: #1976d2;
}

.status-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef2ff;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
}

.status-pill {
  position: relative;
  margin: 0;
}

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

.status-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  min-width: 84px;
}

.status-pill input:checked + span {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}

.approval-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.approval-actions-inline {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.approval-actions-inline form {
  margin: 0;
}

.approval-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-row-inline {
  flex-wrap: nowrap;
}

#tab-rotina .recorrencia-dias {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#tab-rotina .recorrencia-row {
  display: contents;
}

#tab-rotina .recorrencia-dia {
  min-width: 50px;
  padding: 4px 0;
  font-size: 0.8rem;
}

#tab-rotina .routine-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

#tab-rotina .routine-actions form {
  margin: 0;
}

#tab-rotina .routine-actions .btn {
  min-width: 84px;
}

.approval-row input[type="text"],
.approval-row input[type="number"] {
  width: auto;
  min-width: 130px;
}

.motivo-input {
  min-width: 220px;
}

.motivo-input-compact {
  min-width: 140px;
  max-width: 170px;
}

.pontos-input {
  min-width: 68px;
  max-width: 78px;
}

.approval-row .motivo-input {
  min-width: 220px;
}

.approval-row input[type="number"].pontos-input {
  min-width: 68px;
  max-width: 78px;
}

.approval-row .motivo-input.motivo-input-compact {
  min-width: 140px;
  max-width: 170px;
}

.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0;
}

.password-toggle:hover {
  background: rgba(99, 102, 241, .08);
  color: var(--primary);
  transform: translateY(-50%);
}

.password-toggle:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.rotina-padrao-weekdays {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px 6px;
  flex-wrap: nowrap;
  background: transparent;
  border-radius: 32px;
  padding: 8px 0;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 100%;
}

.rotina-padrao-weekdays-row {
  display: contents;
}

.rotina-padrao-weekday-label {
  margin: 0;
  cursor: pointer;
}

.rotina-padrao-weekday-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  width: 58px;
  padding: 6px 0;
  border-radius: 24px;
  font-size: .95rem;
  font-weight: 600;
  transition: background .2s, color .2s;
  background: #f1f5f9;
  color: #888;
}

.rotina-padrao-weekday-label input[type="checkbox"]:checked + .rotina-padrao-weekday-chip {
  background: #6366f1 !important;
  color: #fff !important;
}

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

input[type="date"],
input[type="time"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-inline-size: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 42px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  position: relative;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  min-height: 1.2em;
  width: 100%;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  align-items: center;
  min-width: 100%;
}

input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

input[type="time"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 8.5v4l2.5 1.5'/%3E%3C/svg%3E");
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 8px;
  top: 0;
  width: 36px;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

select {
  min-width: 140px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364758b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

select.filter-input {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  max-width: 150px;
}

.dashboard-filter-select {
  min-width: 140px;
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  padding: 4px 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-pendente {
  background: var(--warning-light);
  color: #92400e;
}

.badge-submetida {
  background: var(--info-light);
  color: #1d4ed8;
}

.badge-aprovada, .badge-aprovado {
  background: var(--success-light);
  color: #065f46;
}

.badge-rejeitada, .badge-rejeitado {
  background: var(--danger-light);
  color: #991b1b;
}

.badge-solicitado {
  background: var(--info-light);
  color: #1e40af;
}

/* ============================================================
   MESSAGES / TOASTS
   ============================================================ */

/* Legacy .messages container — hidden by toasts.js on load */
.messages { display: none !important; }

/* New toast system */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 500px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastIn 0.3s ease-out;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.toast-hiding {
  animation: toastOut 0.3s ease-in forwards;
}

.toast-text {
  flex: 1;
  text-align: center;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0 0 12px;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-20px); }
}

.toast-success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.toast-error {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.toast-info {
  background: var(--info-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ============================================================
   PROFILE SELECTION (SELECT PROFILE PAGE)
   ============================================================ */
.profile-select-body {
  min-height: 100vh;
  background: linear-gradient(160deg, #ede9fe 0%, #f0f4fb 50%, #fce7f3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.profile-select-main {
  width: 100%;
  max-width: 900px;
}

.profile-select-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 36px;
}

.profile-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

.profile-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 28px 20px;
  width: 180px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99,102,241,.15);
}

.profile-card.card-active {
  border-color: var(--primary);
  width: 240px;
  cursor: default;
}

.profile-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.parent-avatar {
  background: linear-gradient(135deg, var(--primary), #818cf8);
}

.kid-avatar {
  background: linear-gradient(135deg, #ec4899, #f9a8d4);
}

/* ── Profile card head: avatar + name side by side ── */
.profile-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.profile-card-head .profile-card-avatar {
  width: 56px;
  height: 56px;
  margin: 0;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.profile-card-head > div:last-child {
  text-align: left;
}

.profile-card-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Avatar grid picker ── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 10px;
  padding: 8px 0;
}

.avatar-option {
  background: var(--bg);
  border: 3px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}

.avatar-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.3);
  transform: scale(1.06);
}

.avatar-option img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* ── Current avatar display (kid area) ── */
.avatar-current {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary);
}

/* ── Avatar initial fallback (inline in tables) ── */
.avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 4px;
}

.profile-card-role {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.profile-pin-form {
  margin-top: 12px;
  text-align: left;
}

.pin-input-wrap {
  margin-bottom: 4px;
}

.pin-input {
  width: 100%;
  text-align: center;
  letter-spacing: 4px;
  font-size: 1.3rem;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
}

.pin-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.pin-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.profile-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  padding: 4px 0;
  text-decoration: underline;
  display: block;
  margin: 8px auto 0;
}

@media (max-width: 480px) {
  .profile-cards {
    gap: 14px;
  }
  .profile-card {
    width: 140px;
    padding: 20px 12px;
  }
  .profile-card.card-active {
    width: 200px;
  }
  .profile-card-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }
  .profile-select-title {
    font-size: 1.5rem;
  }
}

/* ============================================================
   KID AREA
   ============================================================ */
.kid-body {
  min-height: 100vh;
  background: linear-gradient(160deg, #ede9fe 0%, #f0f4fb 40%, #fce7f3 100%);
}

.kid-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.kid-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kid-header h1 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--primary);
}

.kid-header h1 .brand-bang {
  font-size: 1.35rem;
}

.kid-header nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kid-header nav a {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}

.kid-header nav a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.kid-header nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.kid-logout-link {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-full);
}

.kid-logout-link::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H4'/%3E%3C/svg%3E");
}

.kid-logout-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.kid-content {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-width: 1200px;
  margin: 0 auto;
}

.kid-greeting {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.kid-panel-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.kid-panel-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* Kid panel — conquista summary cards */
.kid-conquistas-summary {
  grid-template-columns: repeat(4, 1fr) !important;
  margin-top: 16px;
}

.kid-conquista-card {
  text-align: center;
  padding: 16px 12px !important;
}

.kid-panel-grid-3 .card {
  text-align: center;
}

.kid-conquista-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 4px;
}

/* Kid panel — tarefas section */
.kid-tarefas-section {
  margin-top: 56px;
}

/* Kid panel — tarefas header */
.kid-tarefas-header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.kid-tarefas-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.kid-tarefas-header input[type="date"] {
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* Kid panel — tarefa cards grid */
.kid-tarefas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Kid panel — individual tarefa card */
.kid-tarefa-card {
  display: flex;
  flex-direction: column;
}

.kid-tarefa-body {
  flex: 1;
}

.kid-tarefa-body h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.kid-tarefa-action {
  margin-top: 12px;
}

.kid-tarefa-action .btn {
  width: 100%;
}

.kid-loja-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.kid-loja-descricao {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  min-height: 3.9em;
}

.kid-loja-pontos {
  margin-top: auto;
  text-align: right;
}

.kid-loja-action {
  margin-top: 12px;
}

.kid-loja-action .btn {
  width: 100%;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.gamification-settings-card .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gamification-settings-card .section-head h2 {
  margin: 0;
  color: var(--text);
}

.gamification-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.gamification-grid .card {
  min-height: 100%;
}

.gamification-card {
  position: relative;
  overflow: hidden;
}

.level-card {
  border-left: 4px solid var(--accent-lavender);
}

.streak-card {
  border-left: 4px solid var(--accent-pink);
}

.achievement-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.achievement-card > * {
  position: relative;
  z-index: 1;
}

.achievement-watermark {
  position: absolute;
  right: 10px;
  bottom: 2px;
  font-size: 4.8rem;
  line-height: 1;
  opacity: 0.12;
  z-index: 0;
  transform: rotate(-10deg);
  user-select: none;
  pointer-events: none;
}

.conquista-icone {
  display: inline-block;
  margin-right: 6px;
}

.conquista-nivel-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.conquista-icone-estrela {
  color: #f59e0b;
}

.achievement-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.achievement-estrela {
  border-left: 4px solid #f59e0b;
}

.achievement-estrela .achievement-watermark {
  color: #f59e0b;
}

.achievement-estrela .achievement-level {
  background: #fffbeb;
  color: #b45309;
}

.achievement-medalha {
  border-left: 4px solid #ec4899;
}

.achievement-medalha .achievement-level {
  background: #fdf2f8;
  color: #be185d;
}

.achievement-trofeu {
  border-left: 4px solid #6366f1;
}

.achievement-trofeu .achievement-level {
  background: #eef2ff;
  color: #4338ca;
}

/* ============================================================
   MOBILE HAMBURGER
   ============================================================ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  z-index: 250;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 46px;
  height: 46px;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
}

.mobile-topbar {
  display: none;
}

.mobile-logout-form {
  display: none;
}

.mobile-logout-btn {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.sidebar-mobile-brand {
  display: none;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 90;
}

.mobile-overlay.active {
  display: block;
}

/* ============================================================
   MANUAL / AJUDA PAGE
   ============================================================ */
.manual-page {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: start;
}

.manual-nav {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.manual-nav-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.manual-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.manual-nav-list li {
  margin-bottom: 2px;
}

.manual-nav-list a {
  display: block;
  padding: 5px 10px;
  font-size: 0.84rem;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all .15s;
  font-weight: 500;
}

.manual-nav-list a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.manual-nav-list ul {
  list-style: none;
  padding-left: 14px;
  margin: 0;
}

.manual-nav-list ul a {
  font-size: 0.8rem;
  padding: 3px 10px;
}

.manual-content {
  max-width: 820px;
}

.manual-main-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}

.manual-back-inline {
  display: none;
}

.manual-lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
}

.manual-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  padding-top: 8px;
  border-top: 2px solid var(--border);
}

.manual-section {
  margin-bottom: 40px;
}

.manual-section:first-child .manual-title {
  border-top: none;
}

.manual-article {
  margin-bottom: 28px;
}

.manual-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
}

.manual-article h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
}

.manual-article h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.manual-article p {
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0 0 10px;
}

.manual-article ul,
.manual-article ol {
  font-size: 0.92rem;
  line-height: 1.7;
  padding-left: 24px;
  margin: 0 0 12px;
}

.manual-article li {
  margin-bottom: 4px;
}

.manual-highlight {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 14px 0;
  font-size: 0.9rem;
}

.manual-highlight p,
.manual-highlight ul,
.manual-highlight ol {
  margin-bottom: 8px;
}

.manual-highlight p:last-child,
.manual-highlight ul:last-child,
.manual-highlight ol:last-child {
  margin-bottom: 0;
}

.manual-tip {
  background: var(--success-light);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin: 14px 0;
  font-size: 0.88rem;
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
}

.manual-warning {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin: 14px 0;
  font-size: 0.88rem;
}

.manual-screenshot {
  margin: 14px 0;
}

.manual-screenshot img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.manual-screenshot img.redimensionar {
  width: 100%;
  max-width: 100%;
}

.screenshot-placeholder {
  background: #f8fafc;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.88rem;
}

.manual-table th,
.manual-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.manual-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manual-table tr:last-child td {
  border-bottom: none;
}

.manual-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 14px 0;
}

.manual-install-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 16px 0;
}

.manual-install-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.manual-install-card h4 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.manual-install-card ol {
  margin: 0 0 14px;
}

.manual-install-card .manual-screenshot img {
  max-width: 680px;
  margin: 0 auto;
}

.comparison-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.manual-back-top {
  text-align: center;
  padding: 24px 0 8px;
}

.faq-item {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.faq-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ============================================================
   RESPONSIVE — TABLET (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px 20px;
  }

  .manual-page {
    grid-template-columns: 1fr;
  }

  .manual-nav {
    position: static;
    max-height: none;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  .manual-main-title,
  .manual-title,
  .manual-article > h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .manual-back-inline {
    display: inline-flex;
    margin-left: auto;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.9;
  }

  .manual-back-inline:hover {
    color: var(--primary);
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 240;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
  }

  .mobile-topbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.4px;
  }

  .mobile-logout-form {
    display: block;
    margin-left: auto;
  }

  .mobile-topbar .mobile-logout-btn {
    min-height: auto;
    padding: 8px 12px;
    font-size: 0.96rem !important;
    color: var(--muted);
  }

  .btn,
  button {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 1rem !important;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: static;
    top: auto;
    left: auto;
    z-index: 250;
    transition: opacity .18s ease, transform .22s ease;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s ease, opacity .2s ease;
    width: min(320px, 86vw);
    height: auto;
    max-height: calc(100vh - 16px);
    box-shadow: var(--shadow-lg);
    padding-top: calc(18px + env(safe-area-inset-top));
    justify-content: flex-start;
    overflow-y: auto;
    opacity: 0;
    z-index: 260;
  }

  .sidebar.open {
    transform: translateX(0);
    opacity: 1;
  }

  .sidebar-top {
    flex: none;
  }

  .sidebar-top .brand {
    display: none;
  }

  .sidebar-brand-row {
    display: none;
  }

  .sidebar-mobile-brand {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.4px;
    margin: 0 0 10px;
    padding: 0 14px 6px;
  }

  .sidebar-footer {
    margin-top: 12px;
    padding-top: 12px;
  }

  .content {
    margin-left: 0;
    padding: calc(78px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gamification-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .gamification-grid > .card,
  .gamification-grid > .gamification-settings-card {
    width: 100%;
  }

  .tabs-bar {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    scrollbar-width: none;
  }

  .tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .tabs-bar .tab-btn {
    flex: 1 0 auto;
    padding: 14px 18px !important;
    font-size: 0.95rem !important;
    white-space: nowrap;
  }

  #tab-gamificacao,
  #tab-rotina {
    padding: 18px 14px 14px !important;
    margin-top: 16px !important;
  }

  #tab-gamificacao > div[style*="display:flex"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  #tab-rotina .section-head,
  #tab-gamificacao .section-head {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px;
  }

  #tab-rotina .section-head .btn,
  #tab-gamificacao .section-head .btn {
    width: 100%;
  }

  #tab-rotina .card,
  #tab-gamificacao .card {
    padding: 16px 14px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  #tab-rotina .table-wrapper,
  #tab-gamificacao .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  #tab-rotina .table-wrapper table,
  #tab-rotina .table-wrapper tbody,
  #tab-rotina .table-wrapper tr,
  #tab-rotina .table-wrapper td {
    width: 100% !important;
    max-width: 100% !important;
  }

  #tab-rotina td[data-label="Titulo"] {
    display: block;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    width: auto !important;
    max-width: none !important;
  }

  #tab-rotina td[data-label="Titulo"]::before {
    display: block;
    margin-bottom: 8px;
  }

  #tab-rotina td[data-label="Titulo"] span[style*="font-weight:600"] {
    display: block;
    margin-bottom: 4px;
  }

  #tab-rotina td[data-label="Horario"] {
    grid-template-columns: minmax(96px, 120px) 1fr;
  }

  #tab-rotina td[data-label="Horario"] {
    white-space: nowrap;
  }

  #tab-rotina td[data-label="Pontos"] {
    grid-template-columns: minmax(96px, 120px) 1fr;
    text-align: left !important;
  }

  #tab-rotina td[data-label="Recorrencia"] {
    display: block;
    text-align: center !important;
    width: 100% !important;
  }

  #tab-rotina td.routine-recorrencia-cell {
    text-align: center !important;
  }

  #tab-rotina .routine-recorrencia-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  #tab-rotina td[data-label="Recorrencia"]::before {
    display: block;
    margin-bottom: 8px;
  }

  #tab-rotina .recorrencia-dias {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    width: 100% !important;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    scrollbar-width: none;
  }

  #tab-rotina .recorrencia-dias .recorrencia-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  #tab-rotina .recorrencia-dias::-webkit-scrollbar {
    display: none;
  }

  #tab-rotina td[data-label="Acoes"] {
    display: block;
    text-align: left !important;
    width: 100% !important;
  }

  #tab-rotina td[data-label="Acoes"] .actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100% !important;
    justify-items: stretch;
  }

  #tab-rotina td[data-label="Acoes"] {
    width: 100% !important;
  }

  #tab-rotina td[data-label="Acoes"] .btn,
  #tab-rotina td[data-label="Acoes"] form,
  #tab-rotina td[data-label="Acoes"] form button,
  #tab-rotina td[data-label="Acoes"] .actions > * {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
  }

  #tab-rotina td[data-label="Acoes"] .actions a.btn,
  #tab-rotina td[data-label="Acoes"] .actions form button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
  }

  #tab-rotina td.routine-actions-cell .routine-actions {
    width: 100% !important;
  }

  #tab-rotina .recorrencia-dia {
    min-width: 0 !important;
    min-width: 58px;
    width: 58px;
    max-width: 58px;
    text-align: center;
    padding: 4px 0 !important;
    min-height: 32px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    justify-self: center;
  }

  #tab-rotina .recorrencia-dia:nth-child(5) {
    grid-column: 2;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header .page-title {
    flex-basis: auto;
  }

  .page-title {
    font-size: 1.35rem;
    margin-top: 8px;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-header > .btn,
  .page-header > a.btn {
    align-self: flex-end;
    margin-left: 0;
  }

  .page-header.page-header-inline-mobile {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-header.page-header-inline-mobile > .btn,
  .page-header.page-header-inline-mobile > a.btn {
    align-self: stretch;
    margin-left: 0;
    width: 100%;
  }

  .header-form,
  .header-tools {
    width: 100%;
  }

  .header-form {
    flex-direction: column;
    align-items: stretch;
  }

  .header-form-compact .form-select,
  .header-form-compact input,
  .header-form-compact select,
  .header-form-compact button,
  .header-tools .btn {
    width: 100%;
  }

  .header-form-compact .form-select,
  .header-form-compact input,
  .header-form-compact select,
  .header-form-compact button,
  .header-tools .btn,
  .page-actions .btn,
  .page-actions select,
  .page-actions input {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 1rem !important;
  }

  .header-form-compact input[type="date"],
  .header-form-compact input[type="time"],
  .page-actions input[type="date"],
  .page-actions input[type="time"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .dashboard-filter-form .dashboard-filter-select,
  .dashboard-filter-form .btn {
    min-height: 48px;
    font-size: 1rem !important;
  }

  .dashboard-filter-form .dashboard-filter-select {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dashboard-filter-form #filhoAvatar {
    display: none !important;
  }

  .dashboard-summary-table td[data-label="Avatar"],
  .dashboard-recent-table td[data-label="Avatar"] {
    display: none !important;
  }

  .dashboard-recent-table td[data-label="Status"] {
    display: block;
    text-align: left !important;
  }

  .dashboard-recent-table td[data-label="Status"]::before {
    display: block;
    margin-bottom: 8px;
  }

  .dashboard-recent-table td[data-label="Status"] .badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
  }

  .period-selector {
    width: 100%;
    justify-content: center;
  }

  .period-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  select.filter-input {
    width: 100%;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  input[type="date"],
  input[type="time"] {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    min-height: 48px;
  }

  .form-card {
    padding: 20px 18px;
  }

  .form-card .actions.actions-split {
    flex-wrap: wrap;
    gap: 10px;
  }

  .actions-split .actions-right {
    width: 100%;
    justify-content: flex-end;
  }

  .form-card .actions.actions-split.child-actions-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-card .actions.actions-split.child-actions-row .actions-left,
  .form-card .actions.actions-split.child-actions-row .actions-right {
    width: 100%;
    margin-left: 0;
  }

  .form-card .actions.actions-split.child-actions-row .actions-right {
    flex-direction: column;
  }

  .form-card .actions.actions-split.child-actions-row .btn {
    width: 100%;
  }

  .form-card .actions.actions-split:not(.child-actions-row) {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-card .actions.actions-split:not(.child-actions-row) .actions-left,
  .form-card .actions.actions-split:not(.child-actions-row) .actions-right {
    width: 100%;
    margin-left: 0;
  }

  .form-card .actions.actions-split:not(.child-actions-row) .actions-right {
    flex-direction: column;
  }

  .form-card .actions.actions-split:not(.child-actions-row) .btn {
    width: 100%;
  }

  .child-actions-right {
    margin-right: 0;
  }

  .routine-grid {
    grid-template-columns: 1fr;
  }

  .inline-fields,
  .inline-fields-3,
  .inline-fields-4,
  .inline-fields-compact,
  .routine-inputs {
    grid-template-columns: 1fr !important;
  }

  .field-slim input,
  .field-slim select {
    max-width: none;
  }

  .status-pill-group {
    width: 100%;
    justify-content: space-between;
  }

  .status-pill {
    flex: 1;
  }

  .status-pill span {
    width: 100%;
    min-width: 0;
  }

  .weekday-pill-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .weekday-pill {
    min-width: 0;
  }

  .weekday-pill:nth-child(5) {
    grid-column: 2;
  }

  .weekday-pill:nth-child(6) {
    grid-column: 3;
  }

  .weekday-pill:nth-child(7) {
    grid-column: 4;
  }

  .weekday-pill span {
    width: 100%;
    min-width: 0;
  }

  .task-weekdays-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    justify-items: center;
  }

  .task-weekdays-grid .task-weekdays-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .task-weekdays-grid .task-weekday-pill {
    width: 58px;
    flex: 0 0 58px;
  }

  .task-weekdays-grid .task-weekday-pill span {
    width: 58px;
    min-width: 58px;
  }

  .task-weekdays-grid {
    display: grid;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .task-weekday-pill {
    width: 58px;
    flex: 0 0 58px;
  }

  .task-weekday-pill span {
    width: 58px;
    min-width: 58px;
  }

  .weekday-oval {
    display: grid !important;
    grid-template-columns: repeat(4, max-content);
    justify-content: center !important;
    gap: 8px 6px !important;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 12px !important;
    padding: 8px 0 !important;
  }

  .weekday-oval label {
    margin: 0 !important;
  }

  .weekday-oval label:nth-child(5) {
    grid-column: 2;
  }

  .weekday-oval label span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    width: 58px;
    padding: 6px 0 !important;
    border-radius: 24px !important;
    font-size: 0.9rem !important;
  }

  .rotina-padrao-weekdays {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100%;
    justify-items: center;
  }

  .rotina-padrao-weekdays-row {
    display: flex;
    justify-content: center;
    gap: 8px 6px;
    width: 100%;
  }

  .form-card form > div[style*="display:flex"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  .form-card form > div[style*="display:flex"] > div,
  .form-card form > div[style*="display:flex"] > .form-row {
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
  }

  .form-card form > div.actions[style*="display:flex"] .btn {
    width: 100%;
  }

  th, td {
    padding: 10px 10px;
    font-size: 0.82rem;
  }

  .table-wrapper {
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
    width: 100%;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody {
    display: grid;
    gap: 12px;
    padding: 0 2px;
  }

  .table-wrapper tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 14px 14px 10px;
    width: auto;
  }

  .table-wrapper td {
    border-bottom: 1px dashed var(--border);
    padding: 8px 0;
    font-size: 0.84rem;
  }

  .table-wrapper td:last-child {
    border-bottom: none;
  }

  .table-wrapper td[colspan] {
    border-bottom: none;
    padding: 0;
  }

  .table-wrapper td:not([colspan]) {
    display: grid;
    grid-template-columns: minmax(96px, 120px) 1fr;
    gap: 12px;
    align-items: start;
  }

  .table-wrapper td:not([colspan])::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
  }

  .table-wrapper td.td-actions,
  .table-wrapper td[data-label="Acoes"],
  .table-wrapper td[data-label="Ações"] {
    display: block;
    text-align: left;
    padding-top: 12px;
  }

  .table-wrapper td .actions,
  .table-wrapper td .approval-actions,
  .table-wrapper td .approval-row,
  .table-wrapper td .approval-actions-inline {
    justify-content: flex-start;
    width: 100%;
    gap: 8px;
  }

  .table-wrapper td .actions .btn,
  .table-wrapper td .actions form,
  .table-wrapper td .approval-actions form,
  .table-wrapper td .approval-row input,
  .table-wrapper td .approval-row .btn {
    width: 100%;
    min-width: 0;
  }

  .table-wrapper td .approval-row input[name="motivo"],
  .table-wrapper td .approval-row input[name="observacao"],
  .table-wrapper td .approval-row input[name="pontos_aprovados"] {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    display: block;
  }

  .table-wrapper td .actions form button,
  .table-wrapper td .approval-actions form button {
    width: 100%;
  }

  .table-wrapper td.td-actions::before,
  .table-wrapper td[data-label="Acoes"]::before,
  .table-wrapper td[data-label="Ações"]::before {
    display: none;
  }

  .table-wrapper td .motivo-input,
  .table-wrapper td .motivo-input-compact,
  .table-wrapper td .pontos-input {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .table-wrapper td[data-label="Avatar"] {
    display: none !important;
  }

  .table-wrapper td[data-label="Icone"] {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: none;
    padding-top: 0;
    padding-bottom: 8px;
    width: 100% !important;
  }

  .table-wrapper td[data-label="Icone"]::before {
    display: none;
  }

  .table-wrapper td[data-label="Filho"] img,
  .table-wrapper td[data-label="Filho"] .avatar-initial {
    display: none !important;
  }

  .table-wrapper td.task-child-cell {
    display: grid;
    grid-template-columns: minmax(96px, 120px) 1fr;
    gap: 12px;
    align-items: center;
  }

  .table-wrapper td.task-child-cell::before {
    margin-right: 0;
  }

  .table-wrapper .task-child-value {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 0;
  }

.mobile-inline-label {
  display: none;
}

  .table-wrapper td.task-child-cell .task-child-value {
    white-space: nowrap;
    justify-self: start;
  }

  .table-wrapper td.task-child-inline-cell {
    display: grid;
    grid-template-columns: minmax(96px, 120px) 1fr;
    gap: 12px;
    align-items: center;
  }

  .table-wrapper td.task-child-inline-cell::before {
    display: none;
  }

  .table-wrapper td.task-child-inline-cell .mobile-inline-label {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
  }

  .table-wrapper td .approval-actions-inline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .table-wrapper td .approval-row-inline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: stretch;
  }

  .table-wrapper td .approval-row-inline > * {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .table-wrapper td .approval-row-inline input[type="number"] {
    text-align: center;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  /* Kid area mobile */
  .kid-header {
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  }

  .kid-header-top {
    width: 100%;
  }

  .kid-header h1 {
    font-size: 1.3rem;
    line-height: 1.1;
  }

  .kid-header nav {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    gap: 4px;
  }

  .kid-header nav::-webkit-scrollbar {
    display: none;
  }

  .kid-header nav a {
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .kid-content {
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  }

  .kid-conquistas-summary {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px;
  }

  .kid-conquistas-summary .kid-conquista-card:last-child {
    grid-column: 1 / -1;
  }

  .kid-tarefas-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .kid-panel-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .kid-greeting {
    align-items: flex-start;
  }

  .kid-tarefas-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .kid-tarefas-title,
  .kid-tarefas-header input[type="date"],
  .kid-tarefas-header .btn {
    width: 100%;
  }

  .manual-comparison {
    grid-template-columns: 1fr;
  }

  .manual-install-card .manual-screenshot img {
    max-width: 100%;
  }
}

/* ============================================================
   PWA INSTALL PROMPT
   ============================================================ */
.install-prompt {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1400;
  pointer-events: none;
}

.install-prompt.is-visible {
  animation: installPromptIn .28s ease;
}

.install-prompt-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 38%),
    linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(51, 65, 85, 0.96));
  color: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  pointer-events: auto;
  backdrop-filter: blur(18px);
}

.install-prompt-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.2rem;
}

.install-prompt-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.install-prompt-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  margin-bottom: 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.install-prompt-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
}

.install-prompt-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.install-prompt-icon span {
  display: inline-block;
  margin-left: 1px;
  color: #f59e0b;
  transform: rotate(12deg);
}

.install-prompt-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: #fff;
}

.install-prompt-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.45;
}

.install-prompt-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.install-prompt-steps span {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 600;
}

.install-prompt-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.install-prompt-actions .btn {
  flex: 1;
  min-height: 44px;
}

.install-prompt-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.install-prompt-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

@keyframes installPromptIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kid-conquistas-summary {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .kid-tarefas-grid {
    grid-template-columns: 1fr;
  }

  .weekday-pill-group {
    grid-template-columns: repeat(4, 1fr);
  }

  .task-weekdays-grid {
    width: 100%;
  }

  .kid-header nav a {
    padding: 9px 10px;
    font-size: 0.88rem;
  }

  .kid-logout-link {
    font-size: 0.9rem;
    line-height: 1;
    padding: 9px 10px;
  }

  .kid-greeting img {
    width: 52px !important;
    height: 52px !important;
  }

  .kpi-value {
    font-size: 1.6rem;
  }

  .brand {
    font-size: 1.3rem;
  }

  .install-prompt {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .install-prompt-card {
    padding: 16px 16px 14px;
    border-radius: 20px;
  }

  .install-prompt-head {
    grid-template-columns: 48px 1fr;
    gap: 12px;
  }

  .install-prompt-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.05rem;
  }

  .install-prompt-actions {
    flex-direction: column-reverse;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full { width: 100%; }
