/* ============================================================
   EDUCARE — Design tokens & base styles
   Teal #0F766E + Coral #FB923C — rounded, clinical, calm
   ============================================================ */

:root {
  /* Light theme (default) */
  --bg:          #F6F8F8;
  --bg-grad-a:   #ECF6F4;
  --bg-grad-b:   #F6F8F8;
  --surface:     #FFFFFF;
  --surface-2:   #F1F5F4;
  --surface-3:   #E9F0EE;
  --text:        #142826;
  --text-2:      #45605B;
  --text-3:      #7C928D;
  --border:      #E4ECEA;
  --border-2:    #D6E2DF;

  --primary:        #0F766E;
  --primary-strong: #0C5F58;
  --primary-light:  #14B8A6;
  --primary-soft:   rgba(15,118,110,0.09);
  --primary-soft-2: rgba(15,118,110,0.14);
  --on-primary:     #FFFFFF;

  --accent:       #FB923C;
  --accent-strong:#F2801F;
  --accent-soft:  rgba(251,146,60,0.13);

  /* status hues for calendar legend */
  --st-agendado:    #6366F1;
  --st-confirmado:  #14B8A6;
  --st-compromisso: #FB923C;
  --st-bloqueado:   #94A3B8;
  --st-aniversario: #EAB308;
  --st-feriado:     #EF4444;
  --st-realizado:   #16A34A;
  --st-falta:       #E11D48;

  --shadow-sm: 0 1px 2px rgba(20,40,38,0.05), 0 1px 3px rgba(20,40,38,0.04);
  --shadow:    0 2px 8px rgba(20,40,38,0.05), 0 6px 20px rgba(20,40,38,0.05);
  --shadow-lg: 0 8px 30px rgba(20,40,38,0.10), 0 2px 8px rgba(20,40,38,0.05);
  --shadow-primary: 0 10px 24px rgba(15,118,110,0.28);

  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  --sidebar-w: 264px;
  --rail-w:    348px;

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg:          #0F1A19;
  --bg-grad-a:   #122724;
  --bg-grad-b:   #0F1A19;
  --surface:     #16302C;
  --surface-2:   #1C3A35;
  --surface-3:   #224841;
  --text:        #EAF4F1;
  --text-2:      #A9C2BC;
  --text-3:      #7E9893;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);

  --primary:        #16C8B6;
  --primary-strong: #14B8A6;
  --primary-light:  #2DD4BF;
  --primary-soft:   rgba(22,200,182,0.13);
  --primary-soft-2: rgba(22,200,182,0.20);
  --on-primary:     #042B27;

  --accent:       #FB923C;
  --accent-strong:#FDB572;
  --accent-soft:  rgba(251,146,60,0.16);

  --st-agendado:    #818CF8;
  --st-confirmado:  #2DD4BF;
  --st-compromisso: #FB923C;
  --st-bloqueado:   #7E9893;
  --st-aniversario: #FACC15;
  --st-feriado:     #F87171;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow:    0 2px 10px rgba(0,0,0,0.32);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.45);
  --shadow-primary: 0 10px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--primary-soft-2); }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: padding-box; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 680px at 82% -8%, var(--primary-soft-2), transparent 60%),
    radial-gradient(820px 560px at 6% 108%, var(--accent-soft), transparent 55%),
    linear-gradient(160deg, var(--bg-grad-a), var(--bg-grad-b));
}
.login-blob {
  position: absolute; border-radius: 50%; filter: blur(8px); opacity: .5;
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 432px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 38px 34px;
  animation: rise .55s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { transform: translateY(16px); } }
.login-head { text-align: center; margin-bottom: 26px; }
.login-logo { display: inline-flex; }
.login-title { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; margin: 16px 0 6px; }
.login-sub { color: var(--text-2); font-size: 14.5px; line-height: 1.45; max-width: 320px; margin: 0 auto; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.input-shell {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input-shell:focus-within {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.input-shell svg { color: var(--text-3); flex: none; }
.input-shell input {
  border: none; background: none; outline: none; color: var(--text);
  font-size: 15px; padding: 13px 0; width: 100%;
}
.input-shell input::placeholder { color: var(--text-3); }
.icon-btn-plain { border: none; background: none; color: var(--text-3); display: grid; place-items: center; padding: 4px; border-radius: 8px; }
.icon-btn-plain:hover { color: var(--text); }

.row-between { display: flex; align-items: center; justify-content: space-between; }
.link { color: var(--primary); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.link:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: var(--radius-sm); font-weight: 800; font-size: 15px;
  padding: 14px 18px; transition: transform .12s, box-shadow .2s, background .2s, filter .2s;
}
.btn:active { transform: translateY(1px) scale(.997); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--primary-strong); filter: saturate(1.05); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-coral { background: var(--accent); color: #2a1402; box-shadow: 0 10px 24px var(--accent-soft); }
.btn-coral:hover { background: var(--accent-strong); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; font-weight: 700; margin: 22px 0 18px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.login-foot { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 20px; }

/* ---- AUTH split-screen (brand panel + form) ---- */
.auth-split {
  height: 100%;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  background: var(--bg);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #EAFBF7;
  padding: clamp(28px, 3.2vw, 54px);
  background:
    radial-gradient(120% 80% at 100% 0%, #15897E 0%, transparent 55%),
    radial-gradient(90% 70% at 0% 100%, #0B544E 0%, transparent 60%),
    linear-gradient(150deg, #0F766E 0%, #0B4F49 100%);
}
.ab-blob { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(6px); }
.ab-blob.b1 { width: 360px; height: 360px; top: -130px; right: -90px; opacity: .55;
  background: radial-gradient(circle at 30% 30%, rgba(251,146,60,.55), rgba(251,146,60,0) 70%); }
.ab-blob.b2 { width: 320px; height: 320px; bottom: -120px; left: -80px; opacity: .5;
  background: radial-gradient(circle at 50% 50%, rgba(45,212,191,.45), transparent 70%); }
.ab-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .45; mix-blend-mode: overlay;
  background-size: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.ab-brandrow { position: relative; display: flex; align-items: center; gap: 11px; }
.ab-word { font-size: 20px; font-weight: 900; letter-spacing: -.02em; color: #fff; }

.ab-main { position: relative; margin: auto 0; padding: 26px 0; }
.ab-eyebrow {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: #9FF0E4; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); padding: 7px 14px; border-radius: 99px;
}
.ab-title {
  font-size: clamp(27px, 2.7vw, 41px); line-height: 1.1; font-weight: 900; letter-spacing: -.025em;
  margin: 20px 0 14px; color: #fff;
}
.ab-title span { color: #FFC79A; }
.ab-lede { font-size: 15.5px; line-height: 1.55; color: #C7EAE3; max-width: 440px; margin: 0; }

.ab-stage { position: relative; margin-top: 32px; max-width: 440px; }
.ab-card {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF, #FBF5EC);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 22px; padding: 14px 16px;
  box-shadow: 0 26px 54px rgba(4,40,36,.42);
}
.auth-illu { width: 100%; height: auto; display: block; }
.ab-token {
  position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 15px;
  display: grid; place-items: center; font-weight: 900; font-size: 21px;
  box-shadow: 0 14px 26px rgba(4,40,36,.38);
}
.ab-token.tk1 { top: -20px; left: -18px; background: #FB923C; color: #3a1c03; --r: -8deg; transform: rotate(var(--r)); }
.ab-token.tk2 { bottom: 16px; left: -24px; background: #fff; color: #0F766E; --r: 7deg; transform: rotate(var(--r)); }
.ab-token.tk3 { top: -16px; right: -16px; background: #14B8A6; color: #fff; --r: 9deg; transform: rotate(var(--r)); }

.ab-feats {
  position: relative; list-style: none; margin: 0; padding: 26px 0 0;
  display: flex; flex-wrap: wrap; gap: 11px 20px;
}
.ab-feats li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; color: #D6F1EB; }
.abf-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255,255,255,.1); color: #7EEAD9; }

.auth-pane { display: grid; place-items: center; padding: 28px 24px; overflow: auto; }
.auth-card { width: 100%; max-width: 420px; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head .login-logo { margin-bottom: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .ab-token { animation: floaty 5s ease-in-out infinite; }
  .ab-token.tk2 { animation-delay: -1.6s; }
  .ab-token.tk3 { animation-delay: -3s; }
  @keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(var(--r)); }
    50% { transform: translateY(-8px) rotate(var(--r)); }
  }
}

@media (max-width: 940px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0,1fr) var(--rail-w);
  height: 100%;
  background: var(--bg);
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; }
.sb-brand .bk { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand .bk b { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.sb-brand .bk span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.sb-label { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--text-3); padding: 8px 22px 6px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 0 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; border: none; background: none;
  color: var(--text-2); font-size: 14.5px; font-weight: 700; text-align: left; width: 100%;
  position: relative; transition: background .14s, color .14s;
}
.sb-item svg { flex: none; }
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active { background: var(--primary-soft); color: var(--primary); }
.sb-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--primary);
}
.sb-badge { margin-left: auto; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); }

.sb-foot { border-top: 1px solid var(--border); padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.sb-profile { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; border:none; background:none; width: 100%; text-align: left; }
.sb-profile:hover { background: var(--surface-2); }
.sb-profile .pmeta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sb-profile .pmeta b { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.sb-profile .pmeta span { font-size: 11px; color: var(--text-3); }
.sb-profile .pmeta .plan { color: var(--accent-strong); font-weight: 800; }

.avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }

/* ---- Middle column ---- */
.main-col { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 26px; flex: none;
}
.search {
  flex: 1; display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 16px; box-shadow: var(--shadow-sm);
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search svg { color: var(--text-3); flex:none; }
.search input { border: none; background: none; outline: none; color: var(--text); font-size: 14.5px; padding: 13px 0; width: 100%; }
.search input::placeholder { color: var(--text-3); }

.top-icon { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--shadow-sm); position: relative; transition: color .14s, background .14s; }
.top-icon:hover { color: var(--text); background: var(--surface-2); }
.top-icon .dot { position: absolute; top: 11px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }

.theme-toggle { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; gap: 3px; box-shadow: var(--shadow-sm); flex:none; }
.theme-toggle button { width: 38px; height: 38px; border-radius: 10px; border: none; background: none; color: var(--text-3); display: grid; place-items: center; transition: background .14s, color .14s; }
.theme-toggle button.on { background: var(--primary-soft); color: var(--primary); }

.main-scroll { flex: 1; overflow-y: auto; padding: 0 26px 36px; }

/* email verify banner */
.banner {
  display: flex; align-items: center; gap: 13px;
  background: color-mix(in oklab, var(--st-agendado) 10%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--st-agendado) 24%, var(--border));
  border-left: 4px solid var(--st-agendado);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 22px;
  font-size: 14px; color: var(--text);
}
.banner .bi { color: var(--st-agendado); display: grid; place-items: center; flex:none; }
.banner .pill-btn { background: var(--st-agendado); color:#fff; border:none; border-radius: 9px; font-weight: 800; font-size: 12.5px; padding: 7px 12px; }
.banner .x { margin-left: auto; border: none; background: none; color: var(--text-3); display: grid; place-items: center; padding: 4px; border-radius: 8px; }
.banner .x:hover { color: var(--text); background: var(--surface-2); }

/* breadcrumb */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }
.crumb .cur { color: var(--text-2); }

/* page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 3px; display: flex; align-items: center; gap: 10px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin: 0; }

/* ---- Dashboard empty state ---- */
.welcome { text-align: center; max-width: 520px; margin: 40px auto 8px; }
.welcome .wave { width: 76px; height: 76px; border-radius: 22px; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-light)); box-shadow: var(--shadow-primary); font-size: 36px; }
.welcome h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 22px 0 8px; }
.welcome p { color: var(--text-2); font-size: 15.5px; line-height: 1.5; margin: 0 auto 24px; max-width: 420px; }

.cta-primary {
  display: flex; align-items: center; gap: 16px; text-align: left;
  width: 100%; max-width: 460px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff; border: none; border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow-primary); transition: transform .14s, box-shadow .2s;
}
.cta-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15,118,110,0.34); }
.cta-primary .ci { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.cta-primary .ct b { font-size: 16.5px; font-weight: 800; display: block; }
.cta-primary .ct span { font-size: 13px; opacity: .85; }

.cta-secondary {
  display: flex; align-items: center; gap: 16px; text-align: left;
  width: 100%; max-width: 460px; margin: 0 auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px; box-shadow: var(--shadow-sm);
  transition: border-color .14s, background .14s;
}
.cta-secondary:hover { border-color: var(--primary); background: var(--surface-2); }
.cta-secondary .ci { width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; flex: none; }
.cta-secondary .ct b { font-size: 15.5px; font-weight: 800; display: block; }
.cta-secondary .ct span { font-size: 13px; color: var(--text-3); }

.text-link { display: block; text-align: center; margin: 18px auto 0; color: var(--text-3); font-size: 13.5px; font-weight: 700; background: none; border: none; }
.text-link:hover { color: var(--primary); }

/* pillars */
.pillars-h { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--text-3); margin: 48px 0 16px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 920px; margin: 0 auto; }
.pillar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); transition: transform .14s, box-shadow .2s, border-color .14s; }
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-2); }
.pillar .pi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 12px; }
.pillar b { font-size: 15px; font-weight: 800; display: block; margin-bottom: 4px; }
.pillar p { font-size: 12.8px; color: var(--text-2); line-height: 1.45; margin: 0; }

/* generic placeholder screen */
.ph { display: grid; place-items: center; text-align: center; min-height: 60vh; }
.ph .pbox { max-width: 380px; }
.ph .picon { width: 64px; height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: inline-grid; place-items: center; color: var(--primary); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.ph h2 { font-size: 21px; font-weight: 800; margin: 0 0 8px; }
.ph p { color: var(--text-2); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }

/* ---- Right rail ---- */
.rail { background: var(--bg); border-left: 1px solid var(--border); height: 100%; overflow-y: auto; padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; }

/* mini calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px; }
.cal-head b { font-size: 14.5px; font-weight: 800; }
.cal-nav { width: 30px; height: 30px; border-radius: 9px; border: none; background: none; color: var(--text-2); display: grid; place-items: center; }
.cal-nav:hover { background: var(--surface-2); color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); padding: 4px 8px 12px; gap: 2px; }
.cal-dow { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--text-3); padding: 4px 0; }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--text); border-radius: 9px; border: none; background: none; position: relative; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.muted { color: var(--text-3); opacity: .55; }
.cal-day.today { background: var(--primary); color: var(--on-primary); font-weight: 800; }
.cal-day.today::after { content:""; position:absolute; bottom: 4px; width: 4px; height: 4px; border-radius:50%; background: var(--accent); }
.cal-day.today.has-ev::after { display: none; }
.cal-evs { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
.cal-evdot { width: 4px; height: 4px; border-radius: 50%; }
.cal-day.today .cal-evdot { box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
/* Seleção manual de um dia: contorno (distinto do preenchido de "hoje"). */
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); }
/* Atalho "Hoje" no cabeçalho do calendário. */
.cal-today { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--border-2); background: none; color: var(--primary); cursor: pointer; }
.cal-today:hover { background: var(--primary-soft); }

.legend { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 6px; border-top: 1px solid var(--border); padding: 12px 14px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); font-weight: 600; }
.legend .ld { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.card-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
.card-title .ct { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 800; }
.card-title .ct svg { color: var(--primary); }

.rail-empty { text-align: center; padding: 18px 16px 16px; color: var(--text-3); font-size: 13px; }
.rail-empty .add { margin-top: 8px; display: inline-block; color: var(--primary); font-weight: 800; background:none; border:none; }

.tip { background: linear-gradient(160deg, var(--primary-soft), transparent); }
.tip .tlabel { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--text-3); }
.tip h4 { font-size: 16px; font-weight: 800; margin: 6px 0 8px; display:flex; align-items:center; gap:7px; }
.tip p { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 0; }
.tip .howto { margin-top: 12px; background: var(--surface-2); border-radius: 12px; padding: 11px 12px; }
.tip .howto b { font-size: 12.5px; display: flex; gap: 6px; align-items:center; margin-bottom: 3px; }
.tip .howto p { font-size: 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* mobile drawer scrim — always fixed so it never occupies a grid track */
.scrim { position: fixed; inset: 0; background: rgba(10,20,18,.42); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .26s; }
.scrim.show { opacity: 1; pointer-events: auto; }

@media (max-width: 1240px) {
  .app-grid { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
  .rail { display: none; }
}
@media (max-width: 880px) {
  .app-grid { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 60; transform: translateX(-105%); transition: transform .26s cubic-bezier(.2,.7,.2,1); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .pillars { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: grid !important; }
}
.menu-btn { display: none; width: 46px; height: 46px; border-radius: 14px; flex:none; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--shadow-sm); }

/* install app button (sidebar) */
.sb-install { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 8px; padding: 11px; border-radius: 12px; border: 1.5px dashed var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 13.5px; width: 100%; }
.sb-install:hover { background: var(--primary-soft-2); }

/* mobile bottom navigation */
.bottom-nav { display: none; }
@media (max-width: 880px) {
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 16px rgba(20,40,38,0.06);
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; border: none; background: none; color: var(--text-3); font-size: 10.5px; font-weight: 700; padding: 6px 2px; border-radius: 12px; }
  .bn-item.active { color: var(--primary); }
  .bn-item.active svg { transform: translateY(-1px); }
  .main-scroll { padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important; }
  .save-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: max(16px, env(safe-area-inset-top)); }
}
@media (max-width: 560px) {
  .topbar { padding-left: 16px; padding-right: 16px; gap: 10px; }
  .main-scroll { padding-left: 16px; padding-right: 16px; }
  .top-icon { width: 42px; height: 42px; }
  .theme-toggle button { width: 34px; height: 34px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn { width: 100%; }
  .save-bar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
