:root {
  --bg: #f4f1ea;
  --surface: #faf8f3;
  --card: #ffffff;

  --text: #1a2320;
  --muted: #6c756f;
  --border: #e2dbcf;

  --primary: #2f7a63;
  --primary-strong: #215a49;
  --primary-soft: #e4f1ec;

  --accent: #d4a84f;
  --accent-strong: #b88a2f;

  --danger: #e14b3b;
  --danger-soft: #fde7e4;

  --warning: #e29b1f;
  --warning-soft: #fff3db;

  --success: #1f9d63;
  --success-soft: #e4f7ef;

  --info: #3f7ff0;
  --info-soft: #e8f0ff;

  --shadow-sm: 0 10px 28px rgba(20, 30, 25, 0.08);
  --shadow-md: 0 20px 50px rgba(20, 30, 25, 0.12);

  --radius-xl: 22px;
  --radius-lg: 17px;
  --radius-md: 13px;
  --radius-sm: 10px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #f6f2ea 0%, #eee8dc 100%);
  color: var(--text);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  outline: none;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

/* APP */
.app-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: calc(10px + var(--safe-top));
  padding-right: 12px;
  padding-left: 12px;
  padding-bottom: calc(82px + var(--safe-bottom));
  overflow-x: hidden;
}

/* TOPO */
/* SIDEBAR */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, calc(100vw - 34px));
  height: 100dvh;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(226, 219, 207, 0.86);
  box-shadow: 0 28px 60px rgba(20, 30, 25, 0.16);
  transform: translateX(-104%);
  transition: transform 0.28s ease;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) 14px calc(18px + var(--safe-bottom));
}

.app-sidebar.active {
  transform: translateX(0);
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(47, 122, 99, 0.22);
  flex-shrink: 0;
}

.sidebar-profile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sidebar-profile-copy strong,
.sidebar-profile-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-copy strong {
  font-size: 0.98rem;
}

.sidebar-profile-copy span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: lowercase;
}

.sidebar-profile-copy span.is-premium {
  color: var(--accent-strong);
  font-weight: 700;
}

.sidebar-close-btn {
  position: static;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.sidebar-menu {
  display: grid;
  gap: 8px;
}

.sidebar-label {
  margin: 4px 4px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-link {
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(244, 241, 234, 0.76);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sidebar-link:hover {
  transform: translateY(-1px);
  background: #f7f2e8;
  border-color: var(--border);
}

.sidebar-link-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-link-premium {
  background: linear-gradient(135deg, rgba(47, 122, 99, 0.12) 0%, rgba(212, 168, 79, 0.16) 100%);
  border-color: rgba(212, 168, 79, 0.22);
}

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

.sidebar-link-danger {
  background: #fff6f4;
  color: var(--danger);
  border-color: rgba(225, 75, 59, 0.12);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#screen-title,
.hero-card h2,
.section-head h3,
.modal-card h3 {
  margin: 0;
}

#screen-title {
  font-size: 28px;
  line-height: 1;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 400px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 400px;
}

.auth-btn {
  min-height: 32px;
  padding: 0 11px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.auth-meta strong,
.auth-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-meta strong {
  font-size: 0.74rem;
  line-height: 1.1;
  color: var(--text);
}

.auth-meta span {
  font-size: 0.66rem;
  line-height: 1.1;
  color: var(--muted);
  text-transform: lowercase;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* CARDS */
.hero-card,
.section-card,
.card,
.week-day-card,
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.hero-card {
  padding: 16px;
  margin-bottom: 12px;
}

.section-card {
  padding: 14px;
  margin-bottom: 12px;
}

.card {
  padding: 14px;
  margin-bottom: 12px;
}

.hero-top,
.section-head,
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-progress {
  text-align: right;
}

.hero-progress strong {
  display: block;
  font-size: 20px;
}

.hero-progress span {
  color: var(--muted);
  font-size: 12px;
}

.progress-bar,
.goal-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #ece4d6;
  overflow: hidden;
}

.progress-bar {
  margin-top: 12px;
}

.progress-fill,
.goal-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%);
}

/* FILTROS */
.today-filters {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.day-filter-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4efe5;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.day-filter-btn:hover {
  transform: translateY(-1px);
}

.day-filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.today-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 12px;
}

/* LISTAS */
.list-stack,
.list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.list-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.list-item.priority-open {
  box-shadow: 0 0 0 2px rgba(47, 122, 99, 0.1);
}

.list-item.high {
  border-left: 4px solid var(--danger);
}

.list-item.medium {
  border-left: 4px solid var(--warning);
}

.list-item.low {
  border-left: 4px solid var(--success);
}

.item-left {
  display: flex;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.item-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.item-content strong {
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.item-content span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  word-break: break-word;
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 88px;
}

.tag {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f4efe5;
  color: var(--text);
}

.tag.high {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.medium {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag.low {
  background: var(--success-soft);
  color: var(--success);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.action-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:hover,
.action-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 35, 32, 0.06);
}

.action-complete {
  background: #e6f6ee;
  color: #19a05b;
  border-color: #b9e6cc;
}

.action-reopen {
  background: #fff4df;
  color: #c98b11;
  border-color: #f3ddb0;
}

.action-delete,
.action-delete-inbox {
  background: #fdeceb;
  color: #f0523b;
  border-color: #f6c9c3;
}

.action-convert {
  background: #e9f3ef;
  color: #2f7a63;
  border-color: #c7dfd6;
}

.action-edit,
.action-edit-inbox {
  background: #eef3f7;
  color: #456b8c;
  border-color: #cfdce8;
}

.action-shift-tomorrow {
  background: #eaf0ff;
  color: #4a78ff;
  border-color: #c9d8ff;
}

.action-shift-today {
  background: #e6f5ef;
  color: #2a7a63;
  border-color: #bfe2d4;
}

/* BOTÕES */
.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 13px;
  font-weight: 600;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 122, 99, 0.25);
}

.primary-btn:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

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

.secondary-btn:hover {
  background: #efe8dc;
}

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

.danger-btn:hover {
  filter: brightness(0.96);
}

.full-btn {
  width: 100%;
}

.small {
  min-height: 36px;
  padding: 0 13px;
}

/* INPUTS */
.text-input,
.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 13px;
  color: var(--text);
}

.modal-form textarea {
  min-height: 96px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

.text-input:focus,
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 122, 99, 0.1);
}

.inbox-capture {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

/* SEMANA */
.week-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(70px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.week-strip::-webkit-scrollbar {
  display: none;
}

.day-pill {
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  text-align: center;
}

.day-pill.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
}

.weekly-columns {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.week-day-card {
  padding: 14px;
}

.week-day-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.mini-task {
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 7px;
}

.mini-task strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

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

.weekly-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.stat-card {
  padding: 12px;
  text-align: center;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.stat-card strong {
  font-size: 20px;
}

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

.goal-row {
  display: grid;
  gap: 7px;
}

.goal-row strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

/* PREMIUM */
.plan-status-card {
  margin-bottom: 12px;
}

.plan-status-body {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.plan-status-title {
  display: block;
  line-height: 1.4;
}

.plan-status-text {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.plan-status-body .primary-btn {
  width: fit-content;
}

.premium-modal-card {
  max-width: 420px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(180deg, #ffffff 0%, #faf8f3 100%);
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #f2c76e 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(212, 168, 79, 0.3);
}

.premium-modal-card h3 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.premium-modal-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.premium-features {
  display: grid;
  gap: 8px;
  text-align: left;
  margin-bottom: 18px;
}

.premium-feature {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.premium-prices {
  margin-bottom: 18px;
}

.premium-prices strong {
  display: block;
  font-size: 20px;
  margin-bottom: 3px;
}

.premium-prices span {
  color: var(--muted);
  font-size: 13px;
}

.premium-actions {
  display: grid;
  gap: 9px;
}

/* NAV INFERIOR */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 736px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 7px;
  z-index: 40;
}

.nav-item {
  min-height: 44px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(12px, env(safe-area-inset-top))
    12px
    max(12px, env(safe-area-inset-bottom));
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  position: relative;
}

.small-modal,
.delete-modal-card {
  max-width: 420px;
}

.icon-btn,
.icon-btn.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #f4efe5;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

.modal-card h3 {
  padding-right: 40px;
}

.modal-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-actions,
.delete-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.modal-actions > *,
.delete-actions > * {
  flex: 1;
}

/* ANIMAÇÕES AUTH */
.auth-box,
.auth-btn,
.auth-meta,
.auth-meta strong,
.auth-meta span {
  transition:
    transform 0.24s ease,
    opacity 0.24s ease,
    background 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    color 0.24s ease;
}

.auth-box {
  transform-origin: center;
}

.auth-box.auth-animating {
  animation: authBoxSwap 0.42s ease;
}

.auth-box.auth-success {
  animation: authSuccessPulse 0.55s ease;
}

.auth-box.auth-logout {
  animation: authLogoutFade 0.38s ease;
}

.auth-meta.is-changing strong,
.auth-meta.is-changing span {
  animation: authTextSwap 0.32s ease;
}

.auth-btn.is-changing {
  animation: authButtonPress 0.28s ease;
}

.auth-box.logged-in {
  background: rgba(228, 241, 236, 0.92);
  border-color: rgba(47, 122, 99, 0.22);
  box-shadow: 0 12px 28px rgba(47, 122, 99, 0.14);
}

.auth-box.logged-out {
  background: rgba(255, 255, 255, 0.78);
}

.auth-status-online {
  color: var(--success) !important;
}

.auth-status-offline {
  color: var(--muted) !important;
}

@keyframes authBoxSwap {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  30% {
    transform: scale(0.985);
    opacity: 0.88;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes authTextSwap {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  45% {
    opacity: 0;
    transform: translateY(4px);
  }
  55% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authSuccessPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(47, 122, 99, 0);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px rgba(47, 122, 99, 0.08);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(47, 122, 99, 0);
  }
}

@keyframes authLogoutFade {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.99);
    opacity: 0.82;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes authButtonPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

/* OCULTAR SCROLLBAR VISUALMENTE NO MOBILE */
@media (max-width: 640px) {
  html,
  body,
  .main-content,
  .modal,
  .modal-card,
  .week-strip {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  .main-content::-webkit-scrollbar,
  .modal::-webkit-scrollbar,
  .modal-card::-webkit-scrollbar,
  .week-strip::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
    padding-bottom: calc(78px + var(--safe-bottom));
  }

  .topbar {
    flex-direction: column;
    gap: 9px;
    margin-bottom: 12px;
  }

  .topbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .auth-box {
    max-width: 100%;
    width: 100%;
  }

  .auth-btn {
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .auth-meta strong {
    font-size: 0.7rem;
  }

  .auth-meta span {
    font-size: 0.63rem;
  }

  .topbar .primary-btn {
    width: 100%;
  }

  #quick-add-btn {
    width: auto;
  }

  #screen-title {
    font-size: 25px;
  }

  .hero-card,
  .section-card,
  .card,
  .modal-card,
  .week-day-card {
    border-radius: 18px;
  }

  .weekly-stats {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .field-grid-3 {
    grid-template-columns: 1fr;
  }

  .inbox-capture {
    grid-template-columns: 1fr;
  }

  .list-item {
    flex-direction: column;
    align-items: stretch;
    padding: 11px;
  }

  .item-right {
    align-items: stretch;
    min-width: 0;
  }

  .item-actions {
    justify-content: flex-start;
  }

  .modal {
    align-items: flex-end;
    justify-content: center;
    padding:
      max(8px, env(safe-area-inset-top))
      8px
      max(8px, env(safe-area-inset-bottom));
  }

  .modal-card {
    max-width: 100%;
    max-height: min(86dvh, calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    border-radius: 20px 20px 16px 16px;
    padding: 16px 14px 14px;
    margin-top: auto;
  }

  .small-modal,
  .delete-modal-card {
    max-width: 100%;
  }

  .icon-btn.close-btn {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .modal-card h3,
  .premium-modal-card h3 {
    font-size: 18px;
    line-height: 1.2;
    padding-right: 36px;
  }

  .modal-form {
    gap: 10px;
    margin-top: 14px;
  }

  .field {
    gap: 6px;
  }

  .field label {
    font-size: 11px;
  }

  .modal-actions,
  .delete-actions {
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 14px;
  }

  .modal-actions > *,
  .delete-actions > * {
    width: 100%;
  }

  .premium-modal-card {
    text-align: left;
  }

  .premium-badge {
    margin-bottom: 10px;
  }

  .premium-modal-card p {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
  }

  .premium-features {
    gap: 7px;
    margin-bottom: 14px;
  }

  .premium-feature {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 11px;
  }

  .premium-prices {
    margin-bottom: 14px;
  }

  .premium-prices strong {
    font-size: 18px;
  }

  .premium-prices span {
    font-size: 12px;
  }

  .premium-actions {
    gap: 8px;
  }

  .plan-status-body .primary-btn {
    width: 100%;
  }

  .bottom-nav {
    width: calc(100% - 20px);
    bottom: calc(8px + var(--safe-bottom));
    padding: 6px;
    border-radius: 18px;
  }

  .nav-item {
    min-height: 42px;
    border-radius: 13px;
    font-size: 12px;
  }
}

  .topbar-brand {
    width: 100%;
  }

  .menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .app-sidebar {
    width: min(300px, calc(100vw - 24px));
    padding-left: 12px;
    padding-right: 12px;
  }

@media (max-width: 380px) {
  .app-shell {
    padding-right: 8px;
    padding-left: 8px;
    padding-bottom: calc(74px + var(--safe-bottom));
  }

  #screen-title {
    font-size: 23px;
  }

  .hero-card,
  .section-card,
  .card,
  .week-day-card {
    padding: 12px;
  }

  .item-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .item-content strong {
    font-size: 13px;
  }

  .item-content span {
    font-size: 11px;
  }

  .action-btn {
    min-height: 28px;
    padding: 0 8px;
    font-size: 10px;
  }

  .day-filter-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 40px;
    font-size: 13px;
  }

  .text-input,
  .modal-form input,
  .modal-form select,
  .modal-form textarea {
    min-height: 42px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .modal {
    padding:
      max(6px, env(safe-area-inset-top))
      6px
      max(6px, env(safe-area-inset-bottom));
  }

  .modal-card {
    max-height: min(88dvh, calc(100dvh - 8px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    padding: 14px 12px 12px;
    border-radius: 18px 18px 14px 14px;
  }

  .modal-card h3,
  .premium-modal-card h3 {
    font-size: 17px;
  }

  .modal-form {
    gap: 9px;
  }

  .premium-feature {
    font-size: 12px;
  }
}


.premium-access-note {
  margin: 6px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  text-align: center;
}

.premium-access-note.is-success {
  background: #ecfdf3;
  border-color: #b7ebcd;
  color: #166534;
}

.premium-access-note.is-error {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.auth-status-premium {
  color: #9a6b12 !important;
}

/* ===== Utility panel ===== */
.utility-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 205;
}

.utility-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.utility-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100dvh;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 34px rgba(15, 23, 42, 0.12);
  transform: translateX(102%);
  transition: transform 0.24s ease;
  z-index: 210;
  display: flex;
  flex-direction: column;
}

.utility-panel.active {
  transform: translateX(0);
}

body.utility-open {
  overflow: hidden;
}

.utility-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: max(18px, env(safe-area-inset-top)) 18px 14px;
  border-bottom: 1px solid var(--border);
}

.utility-panel-head h2 {
  font-size: 1.8rem;
}

.utility-panel-body {
  padding: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 16px;
}

.utility-stack {
  display: grid;
  gap: 16px;
}

.utility-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.utility-card h3 {
  font-size: 1.08rem;
}

.utility-card p,
.utility-card span,
.utility-card label,
.utility-card li {
  color: var(--muted);
}

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

.utility-stat {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.72);
  display: grid;
  gap: 6px;
}

.utility-stat span {
  font-size: 0.84rem;
}

.utility-stat strong {
  font-size: 1.65rem;
  line-height: 1;
}

.report-bars {
  display: grid;
  gap: 10px;
}

.report-row {
  display: grid;
  gap: 6px;
}

.report-row strong,
.setting-row strong,
.help-shortcut strong {
  display: block;
  color: var(--text);
}

.report-bar-track,
.goal-bar {
  overflow: hidden;
}

.report-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(47, 122, 99, 0.12);
}

.report-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.report-days {
  display: grid;
  gap: 10px;
}

.report-day-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.report-day-chip strong {
  color: var(--text);
}

.settings-list {
  display: grid;
  gap: 12px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
}

.setting-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.setting-row-stackable {
  grid-template-columns: 1fr;
  align-items: flex-start;
}

.setting-row-stackable .segmented-select {
  width: 100%;
}

.setting-row-stackable .segmented-pill {
  min-width: 96px;
}

.switch {
  position: relative;
  width: 52px;
  height: 32px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: #d7ddd7;
  border-radius: 999px;
  transition: 0.2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: 0.2s ease;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.segmented-select {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.segmented-select label {
  cursor: pointer;
  display: block;
}

.segmented-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 96px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.segmented-select input:checked + .segmented-pill {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}

.help-faq {
  display: grid;
  gap: 10px;
}

.help-faq details {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.76);
  padding: 14px;
}

.help-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.help-faq p {
  margin-top: 10px;
}

.help-shortcuts {
  display: grid;
  gap: 10px;
}

.help-shortcut {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.78);
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.text-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.88);
  color: var(--text);
  font-weight: 700;
}

.text-link-btn:hover {
  transform: translateY(-1px);
}

body.compact-mode .section-card,
body.compact-mode .hero-card,
body.compact-mode .list-item,
body.compact-mode .week-day-card,
body.compact-mode .inbox-capture {
  border-radius: 18px;
}

body.compact-mode .section-card,
body.compact-mode .hero-card,
body.compact-mode .week-day-card {
  padding: 16px;
}

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

  .utility-panel {
    width: 100vw;
    border-left: 0;
  }

  .setting-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .segmented-select {
    width: 100%;
  }

  .segmented-pill {
    min-width: 88px;
  }
}


.premium-share-card {
  gap: 16px;
}

.premium-share-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  align-self: flex-start;
}

.segment-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.segment-btn.is-active {
  background: linear-gradient(135deg, #4d8b6b 0%, #d0b04f 100%);
  color: #fff;
}

.premium-share-preview {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 16px;
  font: inherit;
  line-height: 1.5;
  color: var(--text);
}

.premium-share-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.premium-share-actions .primary-btn,
.premium-share-actions .secondary-btn {
  flex: 1 1 220px;
}



/* ===== BOTÃO NOVO REFINADO ===== */
#quick-add-btn {
  min-width: 104px;
  justify-content: center;
  border-radius: 14px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #quick-add-btn {
    position: fixed;
    right: 14px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    box-shadow: 0 14px 32px rgba(31, 95, 82, 0.28);
    z-index: 1200;
  }

  #quick-add-btn::before {
    content: "+";
    font-size: 28px;
    line-height: 1;
    font-weight: 500;
    color: #fff;
  }

  .topbar-actions {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-bottom: calc(152px + var(--safe-bottom));
  }

  #quick-add-btn {
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
  }
}


.field-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.field-optional {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.item-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(63, 127, 240, 0.10);
  color: var(--info);
  font-size: 11px;
  font-weight: 700;
}
