/* ═══════════════════════════════════════════════════════════
   PAINEL — Design System 2026
   PWA Native-Feel · Plus Jakarta Sans · Teal Accent
   ═══════════════════════════════════════════════════════════ */

/* ── 1. VARIABLES ─────────────────────────────────────── */
:root {
  --bg:             #f5f9f7;
  --surface:        #ffffff;
  --surface2:       #f0f7f4;
  --surface-glass:  rgba(255,255,255,0.72);
  --border:         #d1e7dd;
  --border-strong:  #a7d1bc;
  --text:           #1a2e28;
  --text-muted:     #5f7c72;
  --text-light:     #8fa99f;
  --accent:         #059669;
  --accent-hover:   #047857;
  --accent-light:   #d1fae5;
  --accent-lighter: #ecfdf5;
  --accent-grad:    linear-gradient(135deg, #059669 0%, #34d399 100%);
  --accent-grad-h:  linear-gradient(135deg, #047857 0%, #10b981 100%);
  --green:          #22c55e;
  --green-light:    #dcfce7;
  --orange:         #f97316;
  --orange-light:   #fff7ed;
  --red:            #ef4444;
  --red-light:      #fee2e2;
  --yellow:         #eab308;
  --yellow-light:   #fefce8;
  --sidebar-w:      260px;
  --radius:         18px;
  --radius-sm:      12px;
  --radius-xs:      8px;
  --shadow:         0 4px 24px rgba(5,150,105,0.07);
  --shadow-md:      0 6px 32px rgba(5,150,105,0.10);
  --shadow-lg:      0 8px 40px rgba(5,150,105,0.14);
  --shadow-accent:  0 4px 20px rgba(5,150,105,0.28);
  --shadow-fab:     0 6px 24px rgba(5,150,105,0.40);
  --transition:     0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --spring:         0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --bounce:         0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --bottom-nav-h:   68px;
  --safe-bottom:    env(safe-area-inset-bottom, 0px);
}


/* ── 2. RESET & BASE ──────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

img { max-width: 100%; display: block; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ── 3. TYPOGRAPHY ────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.text-gradient {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 8px;
}


/* ── 4. LAYOUT ────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px 48px;
  max-width: calc(100vw - var(--sidebar-w));
  min-height: 100vh;
  min-height: 100dvh;
}


/* ── 5. SIDEBAR ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: 4px 0 32px rgba(5,150,105,0.04);
}

.sidebar-logo {
  padding: 28px 20px 20px;
  border-bottom: 1.5px solid var(--border);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent-grad);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: var(--shadow-accent);
  transition: transform var(--spring);
}

.logo-icon:hover { transform: rotate(15deg) scale(1.05); }

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-text span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-section {
  padding: 12px 12px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 10px;
  margin-bottom: 4px;
  margin-top: 18px;
}

.nav-label:first-child { margin-top: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--accent-lighter);
  color: var(--accent);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: transparent;
  transition: all var(--transition);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.sidebar-user {
  padding: 14px 20px;
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--surface2); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.user-info { flex: 1; }

.user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition);
}

.user-role:hover { color: var(--accent); }


/* ── 6. PAGE HEADER ───────────────────────────────────── */
.page-header { margin-bottom: 28px; }

.greeting {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.page-header h2 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.page-header h2 em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 10px;
  box-shadow: var(--shadow);
}


/* ── 7. GRID ──────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-grid-bottom {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}

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


/* ── 8. CARDS ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  animation: fadeUp 0.4s ease both;
  position: relative;
  overflow: hidden;
}

.card--clickable {
  cursor: pointer;
}

.card--clickable:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card--clickable:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 0.08s;
}

.card:nth-child(1) { animation-delay: 0.03s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.09s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.15s; }
.card:nth-child(6) { animation-delay: 0.18s; }

.card-hero {
  background: var(--accent-grad);
  border: none;
  color: white;
  box-shadow: 0 8px 32px rgba(5,150,105,0.35);
}

.card-hero:hover {
  box-shadow: 0 12px 40px rgba(5,150,105,0.45);
}

.card-hero .card-label { color: rgba(255,255,255,0.75); }
.card-hero .card-value { color: white; }
.card-hero .card-sub { color: rgba(255,255,255,0.7); }

.card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.card-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.card-value--positive { color: var(--green); }
.card-value--negative { color: var(--red); }
.card-value--neutral  { color: var(--text); }
.card-value--accent   {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}


/* ── 9. PROGRESS BARS ─────────────────────────────────── */
.progress-wrap {
  margin-top: 12px;
  background: var(--bg);
  border-radius: 99px;
  height: 7px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--accent-grad);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.progress-bar--green  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.progress-bar--orange { background: linear-gradient(90deg, #f97316, #fb923c); }
.progress-bar--red    { background: linear-gradient(90deg, #ef4444, #f87171); }


/* ── 10. PILLS & BADGES ──────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  white-space: nowrap;
}

.pill--green  { background: var(--green-light);  color: #16a34a; }
.pill--orange { background: var(--orange-light); color: #ea580c; }
.pill--red    { background: var(--red-light);    color: #dc2626; }
.pill--yellow { background: var(--yellow-light); color: #ca8a04; }
.pill--white  { background: rgba(255,255,255,0.25); color: white; }


/* ── 11. STATUS DOTS ──────────────────────────────────── */
.status-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.dot--ok   { background: var(--green); }
.dot--warn { background: var(--orange); }
.dot--off  { background: var(--border); }


/* ── 12. HUMOR CHIPS ──────────────────────────────────── */
.humor-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.humor-chip {
  flex: 1;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  gap: 3px;
  user-select: none;
  -webkit-user-select: none;
}

.humor-chip span {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 600;
}

.humor-chip:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.06);
}

.humor-chip:active {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

.humor-chip.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 4px 16px rgba(5,150,105,0.2);
  transform: scale(1.06);
}


/* ── 13. CHART BARS ───────────────────────────────────── */
.wide-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 80px;
  margin-top: 16px;
}

.wide-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  justify-content: flex-end;
}

.wide-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: var(--accent-light);
  min-height: 4px;
  transition: height 0.6s var(--spring);
}

.wide-bar--filled { background: var(--accent-grad); }
.wide-bar--red    { background: var(--red); opacity: 0.5; }

.wide-bar-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
}

.wide-bar-val {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
}


/* ── 14. HABIT LIST ───────────────────────────────────── */
.habit-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.habit-row:hover { background: var(--surface2); }

.habit-row:active {
  background: var(--accent-lighter);
  transition-duration: 0.05s;
}

.habit-check {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--spring);
  user-select: none;
  -webkit-user-select: none;
}

.habit-check:active { transform: scale(0.85); }

.habit-check--done {
  background: var(--accent-grad);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-accent);
}

.habit-name {
  flex: 1;
  font-weight: 600;
}

.habit-name--done {
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 400;
}

.habit-streak {
  font-size: 0.7rem;
  color: var(--orange);
  font-weight: 700;
}


/* ── 15. FINANCE ROWS ─────────────────────────────────── */
.finance-rows {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.finance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  padding: 6px 0;
}

.finance-row-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-weight: 500;
}

.finance-row-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.finance-row-val {
  font-weight: 700;
  font-size: 0.88rem;
}

.finance-row-val--neg { color: var(--red); }
.finance-row-val--pos { color: var(--green); }

.finance-divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 2px 0;
}


/* ── 16. CHECKLIST ────────────────────────────────────── */
.check-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.check-item:hover { background: var(--surface2); }
.check-item:active { background: var(--accent-lighter); }

.check-box {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--spring);
}

.check-box:active { transform: scale(0.85); }

.check-box--checked {
  background: var(--accent-grad);
  border-color: transparent;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: var(--shadow-accent);
}


/* ── 17. FAB & MODAL ──────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 58px;
  height: 58px;
  background: var(--accent-grad);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.7rem;
  cursor: pointer;
  box-shadow: var(--shadow-fab);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--spring);
  z-index: 200;
  line-height: 1;
}

.fab:hover {
  transform: scale(1.1) rotate(45deg);
  box-shadow: 0 8px 32px rgba(5,150,105,0.55);
}

.fab:active {
  transform: scale(0.92);
  transition-duration: 0.08s;
}

.fab--open {
  background: linear-gradient(135deg, #1a2e28, #2d4a40);
  box-shadow: 0 8px 32px rgba(26,46,40,0.4);
  transform: scale(1.1) rotate(45deg);
}

.fab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,46,40,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 28px 100px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.fab-overlay--open {
  opacity: 1;
  visibility: visible;
}

.fab-modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 290px;
  box-shadow: 0 16px 60px rgba(5,150,105,0.2);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-overlay--open .fab-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.fab-modal h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.fab-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.fab-action:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.fab-action:active {
  background: var(--accent-light);
  transform: scale(0.97);
  transition-duration: 0.05s;
}

.fab-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: all var(--transition);
}

.fab-action:hover .fab-action-icon {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-accent);
}


/* ── 18. BOTTOM NAV ───────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  z-index: 100;
  justify-content: space-around;
  box-shadow: 0 -4px 24px rgba(5,150,105,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.3px;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.bn-item:active { transform: scale(0.9); transition-duration: 0.05s; }

.bn-item.active { color: var(--accent); }

.bn-icon-wrap {
  width: 36px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.bn-item.active .bn-icon-wrap {
  background: var(--accent-light);
}


/* ── 19. TOGGLES & FORMS ─────────────────────────────── */
.toggle {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}

.toggle--on {
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(5,150,105,0.35);
}

.toggle--off { background: var(--border-strong); }

.toggle-knob {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  transition: left var(--spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle--on .toggle-knob  { left: 20px; }
.toggle--off .toggle-knob { left: 2px; }

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(5,150,105,0.12);
}

.form-input:hover:not(:focus) {
  border-color: var(--border-strong);
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.form-group {
  margin-bottom: 16px;
}

.form-error {
  font-size: 0.74rem;
  color: var(--red);
  font-weight: 600;
  margin-top: 4px;
}


/* ── 19b. CHIP SELECT ─────────────────────────────────── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chip-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 99px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

.chip-option:hover {
  border-color: var(--accent);
  background: var(--accent-lighter);
  color: var(--accent);
}

.chip-option:active {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

.chip-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.chip-option:has(input:checked) {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(5,150,105,0.30);
}

.chip-icon {
  font-size: 0.9rem;
  line-height: 1;
}

@media (max-width: 380px) {
  .chip-option {
    padding: 7px 12px;
    font-size: 0.78rem;
  }
}


/* ── 20. BUTTONS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: scale(0.96);
  transition-duration: 0.05s;
}

.btn--primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  box-shadow: 0 6px 28px rgba(5,150,105,0.4);
  background: var(--accent-grad-h);
}

.btn--full { width: 100%; }

.btn--outline {
  background: none;
  border: 2px dashed var(--border);
  color: var(--text-muted);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--ghost {
  background: none;
  color: var(--text-muted);
  padding: 10px 16px;
}

.btn--ghost:hover {
  background: var(--surface2);
  color: var(--text);
}


/* ── 21. TABS ─────────────────────────────────────────── */
.card-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.tab {
  flex: 1;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  text-align: center;
}

.tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(5,150,105,0.12);
}

.page-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.page-tab {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 16px;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.page-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}


/* ── 22. QUOTE BLOCK ──────────────────────────────────── */
.quote-block {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.86rem;
  font-style: italic;
  font-weight: 500;
  border-left: 3px solid var(--accent);
  color: var(--text);
  transition: all var(--transition);
}

.quote-block:hover { background: var(--accent-lighter); }

.quote-block--off {
  border-left-color: var(--border);
  color: var(--text-muted);
}


/* ── 23. MESSAGES ─────────────────────────────────────── */
.messages-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.message {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  animation: slideInRight 0.3s var(--spring);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.message--success {
  background: rgba(34,197,94,0.12);
  border: 1.5px solid rgba(34,197,94,0.3);
  color: #16a34a;
}

.message--error {
  background: rgba(239,68,68,0.12);
  border: 1.5px solid rgba(239,68,68,0.3);
  color: #dc2626;
}

.message--warning {
  background: rgba(234,179,8,0.12);
  border: 1.5px solid rgba(234,179,8,0.3);
  color: #ca8a04;
}

.message--info {
  background: rgba(5,150,105,0.12);
  border: 1.5px solid rgba(5,150,105,0.3);
  color: var(--accent);
}


/* ── 24. MOOD CHART SVG ───────────────────────────────── */
.mood-chart {
  margin-top: 16px;
  height: 55px;
  position: relative;
}

.mood-svg { width: 100%; height: 100%; }

.sol-info {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
}

.sol-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
  letter-spacing: -1px;
}

.sol-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-progress-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 6px;
}


/* ── 25. UTILITY ──────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.gap-sm { gap: 6px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-xl { font-size: 2rem; }
.text-lg { font-size: 1.25rem; }
.text-md { font-size: 1rem; }
.text-sm { font-size: 0.78rem; }
.text-xs { font-size: 0.7rem; }
.text-muted { color: var(--text-muted); }
.fw-700 { font-weight: 700; }
.w-full { width: 100%; }
.no-select { user-select: none; -webkit-user-select: none; }


/* ── 26. ANIMATIONS ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}


/* ── 27. RESPONSIVE ───────────────────────────────────── */

/* ── LANDSCAPE BLOCK ─────────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {
  body::after {
    content: 'Por favor, use o app em modo retrato';
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: 32px;
  }
}

/* ── MOBILE (portrait, < 768px) ──────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }

  .main {
    margin-left: 0;
    padding: 16px 14px calc(var(--bottom-nav-h) + 20px + var(--safe-bottom));
    max-width: 100vw;
    overflow-x: hidden;
  }

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

  .bottom-nav { display: flex; }

  .fab {
    bottom: calc(var(--bottom-nav-h) + 16px + var(--safe-bottom));
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .fab-overlay {
    padding: 0 14px calc(var(--bottom-nav-h) + 80px + var(--safe-bottom)) 14px;
    align-items: flex-end;
    justify-content: stretch;
  }

  .fab-modal { width: 100%; }

  .page-header { margin-bottom: 20px; }
  .page-header h2 { font-size: 1.5rem; }

  .messages-container {
    left: 14px;
    right: 14px;
    max-width: none;
  }

  .card { padding: 14px; }
  .card-hero { padding: 18px; }
  .card-value { font-size: 1.6rem; }

  .form-input { padding: 12px 14px; font-size: 0.9rem; }
  .form-label { font-size: 0.72rem; }
  .form-group { margin-bottom: 12px; }

  .btn { padding: 12px 18px; font-size: 0.85rem; }

  .section-title { margin-top: 20px; margin-bottom: 10px; }

  .wide-bars { height: 80px; }

  .habit-row { padding: 10px 12px; gap: 10px; }
  .check-item { padding: 10px 12px; gap: 10px; }
}

/* ── SMALL MOBILE (< 380px) ──────────────────────────── */
@media (max-width: 380px) {
  .main { padding: 12px 10px calc(var(--bottom-nav-h) + 16px + var(--safe-bottom)); }

  .dashboard-grid { grid-template-columns: 1fr; gap: 8px; }
  .dashboard-grid-2 { grid-template-columns: 1fr; gap: 8px; }
  .grid-3 { grid-template-columns: 1fr; gap: 8px; }

  .page-header h2 { font-size: 1.3rem; }
  .card-value { font-size: 1.4rem; }

  .humor-chip { font-size: 1rem; }
  .humor-chip span { font-size: 0.48rem; }

  .bottom-nav-label { font-size: 0.55rem; }
}

/* ── TABLET (768px - 1024px) ─────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .main {
    margin-left: 0;
    padding: 28px 24px 40px;
    max-width: 720px;
    margin-inline: auto;
  }

  .sidebar { display: none; }
  .bottom-nav { display: flex; }

  .fab {
    bottom: calc(var(--bottom-nav-h) + 20px);
  }
}

/* ── DESKTOP (> 1024px) ──────────────────────────────── */
@media (min-width: 1025px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }

  .main {
    margin-left: var(--sidebar-w);
    padding: 32px 36px 40px;
    max-width: 900px;
  }

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

  .fab {
    bottom: 32px;
    right: 32px;
  }
}

/* ── LARGE DESKTOP (> 1440px) ────────────────────────── */
@media (min-width: 1440px) {
  .main {
    padding: 40px 48px 48px;
    max-width: 1000px;
  }
}
