:root {
  --primary: #32d74b;
  --primary-dark: #20b83a;
  --primary-soft: #17351f;
  --secondary: #3b82f6;
  --warning: #ffc107;
  --danger: #ff5a5f;
  --text: #f2f4f7;
  --muted: #b5bdc8;
  --surface: #1a1d23;
  --surface-light: #252a33;
  --background: #0f1115;
  --border: #343a46;
  --shadow: 0 20px 60px rgba(0, 0, 0, .38);
  --radius: 22px;
  --container: 1180px;
  --safe-area-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; color: var(--text); background: radial-gradient(circle at 85% 8%, rgba(59,130,246,.14), transparent 30%), radial-gradient(circle at 12% 14%, rgba(50,215,75,.1), transparent 26%), var(--background); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.container { width: min(calc(100% - 32px), var(--container)); margin: 32px auto 60px; }
.main-header { position: sticky; top: 0; z-index: 100; padding-top: var(--safe-area-top); background: rgba(15,17,21,.94); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.nav-container { width: min(calc(100% - 32px), var(--container)); min-height: 76px; margin-inline: auto; display: flex; align-items: center; gap: 20px; }
.logo-nav, .auth-logo { display: flex; align-items: center; gap: 9px; font-size: 1.35rem; font-weight: 800; }
.logo-nav strong, .auth-logo strong { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border-radius: 13px; color: #101410; background: linear-gradient(135deg, var(--primary), var(--warning)); }
.logo-nav span, .auth-logo span { font-weight: 700; }
.user-greeting { margin-left: auto; color: var(--muted); font-size: .86rem; font-weight: 700; }
.nav-menu { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0; list-style: none; }
.nav-menu a, .nav-menu button { min-height: 42px; padding: 0 13px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-size: .83rem; font-weight: 700; }
.nav-menu a:hover, .nav-menu a.active { color: var(--text); background: var(--surface-light); }
.nav-menu .logout { color: #ffb1b4; border: 1px solid rgba(255,90,95,.45); }
.menu-mobile-btn { display: none; margin-left: auto; border: 0; background: transparent; font-size: 1.65rem; cursor: pointer; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 42px; min-height: calc(100vh - 140px); padding: 42px 0; }
.hero h1 { margin: 16px 0 20px; font-size: clamp(2.6rem, 6vw, 4.7rem); line-height: 1.04; letter-spacing: -.055em; }
.hero p { max-width: 680px; margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.65; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 18px; flex-wrap: wrap; margin: 12px 0 24px; }
.page-header h1 { margin: 0 0 7px; font-size: clamp(1.9rem, 4.6vw, 2.8rem); line-height: 1.08; letter-spacing: -.04em; }
.page-header p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.hero-badge, .badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 10px; border: 1px solid rgba(50,215,75,.35); border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .74rem; font-weight: 800; }
.card { padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.card h1, .card h2, .card h3 { margin-top: 0; }
.card p { color: var(--muted); font-size: .92rem; line-height: 1.58; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat { border-top: 5px solid var(--primary); }
.stat:nth-child(2) { border-top-color: var(--secondary); }
.stat:nth-child(3) { border-top-color: var(--warning); }
.stat small { color: var(--muted); font-weight: 700; }
.stat strong { display: block; margin-top: 8px; color: var(--text); font-size: 2.05rem; }
.public-link-card { margin-bottom: 22px; }
.public-link-card h2 { margin-bottom: 6px; }
.public-link-card p { margin: 0; }
.dashboard-public-link { margin: 14px 0; overflow: hidden; white-space: nowrap; font-size: clamp(.62rem, 1.7vw, .92rem); font-weight: 700; }
.public-link-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.public-link-actions .btn { width: 100%; min-height: 46px; }
.public-link-unconfigured .dashboard-public-link { color: var(--muted); white-space: normal; }
.quick-actions { margin-bottom: 22px; }
.quick-actions h2 { margin: 0 0 14px; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.quick-action { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 16px; box-shadow: none; transition: .2s ease; }
.quick-action:hover { transform: translateY(-2px); border-color: var(--secondary); }
.quick-action strong { font-size: .92rem; }
.quick-action small { color: var(--muted); font-size: .74rem; line-height: 1.35; }
label { display: block; margin-bottom: 7px; color: var(--text); font-size: .8rem; font-weight: 800; }
.form-group { margin-bottom: 16px; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--border); border-radius: 11px; outline: none; background: var(--surface-light); color: var(--text); }
input::placeholder, textarea::placeholder { color: #8d96a3; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(50,215,75,.14); }
textarea { min-height: 170px; resize: vertical; line-height: 1.55; }

/* Sistema visual unificado de botões */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 17px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; font-size: .88rem; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; text-align: center; box-shadow: none; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(59,130,246,.28); outline-offset: 2px; }
.btn-primary { color: #08150b; border-color: rgba(76,235,99,.58); background: linear-gradient(180deg, #39df57 0%, #2dcc48 100%); box-shadow: 0 10px 26px rgba(50,215,75,.16); }
.btn-primary:hover { background: linear-gradient(180deg, #4be866 0%, #35d651 100%); box-shadow: 0 12px 30px rgba(50,215,75,.2); }
.btn-secondary { color: #fff; border-color: rgba(92,155,255,.52); background: linear-gradient(180deg, #438bf6 0%, #3378df 100%); box-shadow: 0 8px 22px rgba(59,130,246,.13); }
.btn-secondary:hover { background: linear-gradient(180deg, #5296fa 0%, #3c82e9 100%); }
.btn-outline { color: #4b91ff; border-color: rgba(59,130,246,.9); background: rgba(59,130,246,.025); }
.btn-outline:hover { border-color: #65a3ff; background: rgba(59,130,246,.09); }
.btn-neutral { color: var(--text); border-color: rgba(181,189,200,.34); background: rgba(181,189,200,.055); }
.btn-neutral:hover { border-color: rgba(181,189,200,.52); background: rgba(181,189,200,.1); }
.btn-danger { color: #ffc6c8; border-color: rgba(255,90,95,.5); background: linear-gradient(180deg, rgba(104,35,39,.48), rgba(79,29,33,.48)); }
.btn-danger:hover { color: #ffe1e2; border-color: rgba(255,90,95,.72); background: rgba(255,90,95,.18); }
.btn:disabled { opacity: .58; cursor: not-allowed; transform: none; box-shadow: none; }

/* Botões de ação com hierarquia, ícone e descrição curta */
.btn-action-tile { min-height: 66px; justify-content: flex-start; gap: 12px; padding: 11px 14px; text-align: left; }
.btn-action-icon { flex: 0 0 auto; display: grid; place-items: center; width: 30px; min-width: 30px; font-size: 1.25rem; line-height: 1; }
.btn-action-copy { display: grid; gap: 3px; min-width: 0; text-align: left; }
.btn-action-title { display: block; font-size: .9rem; font-weight: 850; line-height: 1.15; }
.btn-action-description { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.3; }
.btn-primary .btn-action-description { color: rgba(8,21,11,.72); }
.btn-secondary .btn-action-description { color: rgba(255,255,255,.78); }
.btn-danger .btn-action-description { color: #dca5a7; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-card { width: min(470px, 100%); justify-self: end; }
.auth-logo { justify-content: center; margin-bottom: 20px; font-size: 1.85rem; }
.auth-switch { margin-top: 16px; color: var(--muted); text-align: center; }
.auth-switch button { border: 0; background: none; color: var(--secondary); font-weight: 800; cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
td small { color: var(--muted); }
.empty { padding: 34px 12px; color: var(--muted); text-align: center; }
.message { display: none; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; font-weight: 700; }
.message.show { display: block; }
.message.success { color: #b9ffc4; border: 1px solid rgba(50,215,75,.35); background: rgba(50,215,75,.12); }
.message.error { color: #ffd1d3; border: 1px solid rgba(255,90,95,.4); background: rgba(255,90,95,.12); }
.student-page { background: radial-gradient(circle at 50% 0, rgba(50,215,75,.14), transparent 35%), var(--background); }
.student-shell { width: min(850px, calc(100% - 26px)); margin: 36px auto; }
.student-header { margin-bottom: 22px; text-align: center; }
.student-header p { color: var(--muted); }
.student-header .auth-logo { margin-bottom: 8px; }
.plan-section { min-height: 130px; color: var(--text); white-space: pre-wrap; line-height: 1.65; }
.updated { color: var(--muted); font-size: .8rem; }
#error-state { color: #ffd1d3 !important; }
.student-record-container { max-width: 1040px; }
.student-record-header { margin-bottom: 20px; }
.record-back-link { display: inline-flex; align-items: center; min-height: 38px; margin-bottom: 14px; color: var(--secondary); font-size: .88rem; font-weight: 800; }
.student-record-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.student-record-title h1 { margin: 0 0 4px; font-size: clamp(1.9rem, 4.7vw, 2.8rem); letter-spacing: -.04em; }
.student-record-title p { margin: 0; color: var(--muted); font-size: .92rem; }
.record-tabs { position: sticky; top: calc(84px + var(--safe-area-top)); z-index: 20; display: flex; gap: 6px; margin: 0 0 20px; padding: 6px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: rgba(26,29,35,.94); backdrop-filter: blur(12px); scrollbar-width: none; }
.record-tabs::-webkit-scrollbar { display: none; }
.record-tab { flex: 1 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: .84rem; font-weight: 800; }
.record-tab.active { background: var(--surface-light); color: var(--text); }
.record-tab-panel { display: none; }
.record-tab-panel.active { display: block; }
.record-overview-grid { align-items: stretch; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading small { display: block; margin-bottom: 3px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font-size: 1.48rem; letter-spacing: -.025em; }
.profile-data { display: grid; gap: 12px; margin-bottom: 22px; }
.profile-data p { margin: 0; }
.profile-data strong { color: var(--text); }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.metric-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-light); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { margin-bottom: 7px; font-size: .76rem; font-weight: 800; }
.metric-card strong { display: block; margin-bottom: 4px; overflow-wrap: anywhere; font-size: clamp(1.22rem, 4vw, 1.75rem); line-height: 1.1; }
.metric-card small { font-size: .7rem; line-height: 1.35; }
.record-section-card { max-width: 900px; margin-inline: auto; }
.planning-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.section-intro { max-width: 720px; margin: -5px 0 20px; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.sub-card { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-light); }
.sub-card h3 { margin: 0 0 8px; }
.sub-card p { margin: 0 0 16px; font-size: .88rem; }
.sub-card .message { margin-top: 14px; margin-bottom: 0; }
.record-secondary-link { display: inline-flex; margin-top: 18px; color: var(--secondary); font-size: .9rem; font-weight: 800; }
.evolution-entry-grid { align-items: start; }
.compact-form-grid { gap: 12px; }
.compact-form-grid .form-group { margin-bottom: 4px; }
.assessment-group { margin-bottom: 18px; }
.assessment-group h3 { margin: 0 0 12px; color: var(--muted); font-size: .86rem; }
.compact-textarea { min-height: 110px; }
.weight-history-card { margin-top: 20px; }
@media (max-width: 860px) {
  .hero, .grid-2, .grid-3, .stats { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .auth-card { justify-self: stretch; }
  .user-greeting { display: none; }
  .menu-mobile-btn { display: block; }
  .nav-menu { display: none; position: absolute; top: calc(76px + var(--safe-area-top)); left: 16px; right: 16px; flex-direction: column; align-items: stretch; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
  .nav-menu.active { display: flex; }
  .nav-menu a, .nav-menu button { display: block; width: 100%; text-align: left; }
  .planning-actions, .access-grid { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .container { width: min(calc(100% - 24px), var(--container)); margin-top: 24px; }
  .hero { padding-top: 24px; }
  .hero h1 { font-size: 2.45rem; }
  .page-header { margin-bottom: 20px; }
  .page-header h1 { font-size: 1.9rem; }
  .page-header p { font-size: .88rem; }
  .card { padding: 17px; border-radius: 16px; }
  .dashboard-stats { gap: 10px; margin-bottom: 16px; }
  .dashboard-stats .stat { min-height: 0; padding: 13px 16px 14px; }
  .dashboard-stats .stat small { font-size: .76rem; }
  .dashboard-stats .stat strong { margin-top: 4px; font-size: 1.6rem; line-height: 1.15; }
  .public-link-card { margin-bottom: 16px; }
  .public-link-card h2 { font-size: 1.18rem; }
  .public-link-card p { font-size: .82rem; line-height: 1.42; }
  .dashboard-public-link { margin: 11px 0; font-size: clamp(.58rem,2.55vw,.76rem); }
  .public-link-actions { gap: 8px; }
  .public-link-actions .btn { min-height: 44px; padding-inline: 11px; font-size: .82rem; }
  .quick-actions { margin-bottom: 16px; }
  .quick-actions h2 { font-size: 1.18rem; }
  .quick-actions-grid { gap: 10px; }
  .quick-action { padding: 13px 12px; }
  .quick-action strong { font-size: .85rem; }
  .quick-action small { font-size: .68rem; }
  .actions .btn { width: 100%; }
  .btn { min-height: 43px; padding-inline: 15px; font-size: .85rem; }
  .btn-action-tile { min-height: 64px; padding: 10px 12px; }
  .btn-action-title { font-size: .87rem; }
  .btn-action-description { font-size: .69rem; }
  th, td { padding: 11px 8px; }
  .student-record-container { width: min(calc(100% - 24px), 1040px); }
  .student-record-title { align-items: center; }
  .student-record-title h1 { font-size: 1.95rem; }
  .student-record-title p { font-size: .88rem; }
  .record-tabs { top: calc(84px + var(--safe-area-top)); margin-inline: -2px; }
  .record-tab { min-height: 40px; padding-inline: 12px; }
  .section-heading { margin-bottom: 15px; }
  .section-heading h2 { font-size: 1.34rem; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .metric-card { padding: 14px 12px; }
  .metric-card strong { font-size: 1.3rem; }
  .planning-actions .btn, .sub-card .btn { width: 100%; }
  .compact-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .responsive-history { overflow: visible; }
  .responsive-history table, .responsive-history tbody, .responsive-history tr, .responsive-history td { display: block; width: 100%; }
  .responsive-history thead { display: none; }
  .responsive-history tbody { display: grid; gap: 12px; }
  .responsive-history tr { padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-light); }
  .responsive-history td { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 12px; padding: 7px 0; border: 0; }
  .responsive-history td::before { content: attr(data-label); color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .responsive-history td[colspan] { display: block; text-align: center; }
  .responsive-history td[colspan]::before { display: none; }
}
@media (max-width: 390px) {
  .student-record-title { align-items: flex-start; }
  .student-record-title h1 { font-size: 1.82rem; }
  .hero-badge { padding: 5px 8px; font-size: .68rem; }
  .metric-card { padding: 12px 10px; }
  .compact-form-grid { grid-template-columns: 1fr; }
  .dashboard-stats .stat { padding: 11px 14px 12px; }
  .quick-actions-grid { grid-template-columns: 1fr 1fr; }
}

/* FS Fit · refinamento visual moderno 2026-07-20 */
:root { --radius: 14px; }
.card { border-radius: 14px; box-shadow: 0 14px 42px rgba(0,0,0,.3); }
.btn { min-height: 42px; padding-inline: 15px; border-radius: 10px; font-size: .84rem; }
.btn[data-icon]::before { content: attr(data-icon); display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 1.05em; font-size: 1.05em; line-height: 1; font-weight: 900; }
.btn-action-tile { border-radius: 10px; }
.page-header h1 { font-size: clamp(1.65rem, 3.8vw, 2.25rem); letter-spacing: -.035em; }
.section-heading h2, .quick-actions h2, .card > h2 { font-size: 1.22rem; letter-spacing: -.02em; }
.student-record-title h1 { font-size: clamp(1.7rem, 4vw, 2.25rem); }
.metric-card, .sub-card { border-radius: 11px; }
.record-tabs { border-radius: 11px; }
.record-tab { border-radius: 8px; }
.recent-students-card { overflow: hidden; }
.recent-students-heading { margin: 0 0 8px !important; align-items: center; }
.recent-students-heading h2 { font-size: 1.22rem; }
.recent-students-table { table-layout: fixed; }
.recent-students-table th:nth-child(1) { width: 54%; }
.recent-students-table th:nth-child(2) { width: 36%; }
.recent-students-table th:nth-child(3) { width: 10%; }
.recent-student-row { cursor: pointer; transition: background .16s ease; }
.recent-student-row:hover, .recent-student-row:focus-visible { background: rgba(255,255,255,.035); outline: none; }
.recent-student-row.is-locked { cursor: not-allowed; opacity: .58; }
.recent-student-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.recent-student-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.recent-student-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-light); color: var(--text); font-size: .72rem; font-weight: 850; }
.recent-student-chevron { padding-right: 4px; color: var(--muted); text-align: right; font-size: 1.5rem; line-height: 1; }
@media (max-width: 620px) {
  .hero h1 { font-size: 2.1rem; line-height: 1.06; }
  .page-header h1 { font-size: 1.55rem; }
  .page-header p { font-size: .84rem; }
  .card { border-radius: 13px; }
  .btn { min-height: 41px; border-radius: 9px; font-size: .82rem; }
  .section-heading h2, .quick-actions h2, .card > h2 { font-size: 1.14rem; }
  .student-record-title h1 { font-size: 1.62rem; }
  .recent-students-card { padding: 15px; }
  .recent-students-table th, .recent-students-table td { padding: 12px 6px; }
  .recent-student-avatar { flex-basis: 31px; width: 31px; height: 31px; font-size: .68rem; }
  .recent-student-person strong { font-size: .84rem; }
  .recent-students-table td:nth-child(2) { font-size: .8rem; }
}
