:root{
  --bg:#f3f6f4;
  --surface:#ffffff;
  --surface-2:#f8fbf9;
  --text:#18222a;
  --muted:#6a7884;
  --line:#e5ece8;
  --line2:#92b19f;
  --primary:#0f766e;
  --primary-2:#0b5f58;
  --secondary:#111827;
  --secondary-2:#1f2937;
  --soft-green:#d8f3eb;
  --soft-blue:#e9f2ff;
  --soft-purple:#f0eaff;
  --danger:#dc2626;
  --success:#15803d;
  --shadow:0 20px 40px rgba(16,24,40,.06);
  --radius:24px;
  --radius-sm:16px;
}

*{
  box-sizing:border-box;
}

html, body{
  margin:0;
  padding:0;
  font-family:Inter, Arial, Helvetica, sans-serif;
  color:var(--text);
  background:var(--bg);
}

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

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

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

.app-body{
  min-height:100vh;
}

.app-shell{
  display:grid;
  grid-template-columns:280px 1fr;
  min-height:100vh;
}

.sidebar{
  background:linear-gradient(180deg, #0d1b1b 0%, #132727 100%);
  color:#fff;
  padding:28px 22px;
  display:flex;
  flex-direction:column;
  gap:24px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
}

.brand-mark{
  width:48px;
  height:48px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  background:rgba(255,255,255,.12);
  color:#fff;
}

.brand h2{
  margin:0;
  font-size:18px;
}

.brand p{
  margin:4px 0 0;
  color:rgba(255,255,255,.62);
  font-size:13px;
}

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

.nav-link{
  display:flex;
  align-items:center;
  min-height:46px;
  padding:0 14px;
  border-radius:14px;
  color:rgba(255,255,255,.84);
  transition:.2s ease;
}

.nav-link:hover,
.nav-link.active{
  background:rgba(255,255,255,.08);
  color:#fff;
}

.sidebar-footer{
  margin-top:auto;
  display:grid;
  gap:14px;
}

.mini-user{
  padding:16px;
  border-radius:18px;
  background:rgba(255,255,255,.06);
  display:grid;
  gap:4px;
}

.mini-user span{
  color:rgba(255,255,255,.62);
  font-size:13px;
}

.main-panel{
  padding:28px;
  display:grid;
  gap:22px;
}

.page-header,
.hero-card,
.profile-hero,
.section-card,
.stat-card,
.student-card,
.error-card{
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.hero-card,
.profile-hero,
.page-header,
.section-card,
.error-card{
  border-radius:var(--radius);
}

.page-header{
  padding:28px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
}

.hero-card{
  padding:28px;
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-end;
}

.hero-card h1,
.page-header h1,
.profile-hero h1,
.error-card h1{
  margin:8px 0 4px;
  font-size:32px;
  line-height:1.1;
}

.hero-text,
.page-header p,
.profile-hero p,
.section-header p,
.student-card p,
.table-user p,
.empty-state p,
.error-card p{
  margin:10px 0 0;
  color:var(--muted);
  line-height:1.6;
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  border-radius:999px;
  background:var(--soft-green);
  color:var(--primary);
  font-size:12px;
  font-weight:700;
  letter-spacing:.03em;
  text-transform:uppercase;
}

.hero-actions,
.actions-row,
.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:18px;
}

.stat-card{
  border-radius:22px;
  padding:22px;
  display:grid;
  gap:10px;
}

.stat-card span{
  color:var(--muted);
  font-size:14px;
}

.stat-card strong{
  font-size:34px;
  line-height:1;
}

.section-card{
  padding:24px;
}

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

.section-header h2{
  margin:0;
  font-size:22px;
}

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

.student-card{
  border-radius:20px;
  padding:16px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:center;
}

.student-card strong{
  display:block;
  margin-bottom:4px;
}

.student-card p{
  margin:0;
  font-size:14px;
}

.avatar-circle,
.avatar-xl{
  background:linear-gradient(180deg, #d7efe8 0%, #c5ebe0 100%);
  color:#0b5f58;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.avatar-circle{
  width:52px;
  height:52px;
  border-radius:18px;
}

.avatar-circle.small{
  width:42px;
  height:42px;
  border-radius:14px;
}

.avatar-xl{
  width:96px;
  height:96px;
  border-radius:28px;
  font-size:28px;
}

.avatar-circle img,
.avatar-xl img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.status-pill,
.meta-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:0 12px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
}

.status-pill.success{
  background:#dcfce7;
  color:#166534;
}

.status-pill.muted{
  background:#eef2f7;
  color:#475569;
}

.meta-pills{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}

.meta-pill{
  background:var(--surface-2);
  color:var(--secondary-2);
}

.profile-hero{
  padding:28px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:22px;
}

.profile-main{
  display:flex;
  gap:18px;
  align-items:center;
}

.comparison-grid,
.charts-grid,
.photo-grid{
  display:grid;
  gap:18px;
}

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

.mini-card{
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:20px;
  padding:18px;
  display:grid;
  gap:10px;
}

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

.mini-card strong{
  font-size:28px;
}

.charts-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

canvas{
  width:100% !important;
  height:320px !important;
}

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

.photo-card{
  margin:0;
  border-radius:22px;
  overflow:hidden;
  background:var(--surface-2);
  border:1px solid var(--line);
}

.photo-card img{
  width:100%;
  aspect-ratio:4/5;
  object-fit:cover;
}

.photo-card figcaption{
  padding:14px 16px;
  color:var(--muted);
  font-size:14px;
}

.table-wrap{
  overflow:auto;
}

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

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

.data-table th{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
}

.table-user{
  display:flex;
  align-items:center;
  gap:12px;
}

.table-user p{
  margin:4px 0 0;
  font-size:13px;
}

.text-link{
  color:var(--primary);
  font-weight:700;
}

.stack-form{
  display:grid;
  gap:18px;
}

.form-section{
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:22px;
  padding:20px;
}

.form-section h3{
  margin:0 0 16px;
  font-size:18px;
}

.form-grid{
  display:grid;
  gap:16px;
}

.form-grid.one{ grid-template-columns:1fr; }
.form-grid.two{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
.form-grid.three{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
.form-grid.four{ grid-template-columns:repeat(4, minmax(0, 1fr)); }

.form-field{
  display:grid;
  gap:8px;
}

.form-field label{
  font-size:14px;
  font-weight:700;
  color:var(--secondary-2);
}

input,
select,
textarea{
  width:100%;
  min-height:48px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:16px;
  padding:12px 14px;
  outline:none;
  transition:.2s ease;
}

textarea{
  min-height:auto;
  resize:vertical;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#9bd5cb;
  box-shadow:0 0 0 4px rgba(15,118,110,.08);
}

.btn{
  min-height:46px;
  padding:0 18px;
  border:none;
  border-radius:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  font-weight:700;
  transition:.2s ease;
}

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

.btn-block{
  width:100%;
}

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

.btn-primary:hover{
  background:var(--primary-2);
}

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

.btn-secondary:hover,
.btn-dark:hover{
  background:#0b1220;
}

.btn-dark{
  background:#111827;
  color:#fff;
}

.btn-light{
  background:#fff;
  color:var(--secondary);
  border:1px solid var(--line);
}

.btn-ghost{
  background:var(--surface-2);
  color:var(--secondary);
  border:1px solid var(--line);
}

.alert-box,
.info-banner{
  border-radius:18px;
  padding:14px 16px;
  font-size:14px;
}

.alert-box.error{
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.info-banner{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  margin-bottom:18px;
}

.empty-state{
  min-height:220px;
  border:1px dashed var(--line);
  border-radius:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  text-align:center;
  gap:8px;
  padding:24px;
}

.empty-state h3{
  margin:0;
  font-size:22px;
}

.error-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.error-card{
  width:min(560px, 100%);
  padding:30px;
}

.auth-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at top left, rgba(15,118,110,.10), transparent 28%),
    radial-gradient(circle at bottom right, rgba(17,24,39,.08), transparent 32%),
    linear-gradient(180deg, #f7faf8 0%, #eef4f1 100%);
}

.auth-wrapper{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.auth-card{
  width:100%;
  max-width:440px;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(8px);
  border:1px solid rgba(229,236,232,.9);
  border-radius:28px;
  box-shadow:0 24px 50px rgba(16,24,40,.08);
  padding:34px 30px;
}

.auth-header{
  margin-bottom:22px;
}

.auth-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  background:var(--soft-green);
  color:var(--primary);
  font-size:12px;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
  margin-bottom:14px;
}

.auth-header h1{
  margin:0;
  font-size:32px;
  line-height:1.1;
  color:var(--text);
}

.auth-subtitle{
  margin:10px 0 0;
  color:var(--muted);
  line-height:1.65;
  font-size:15px;
}

.auth-form{
  display:grid;
  gap:16px;
  margin-top:8px;
}

.auth-form .btn{
  margin-top:4px;
}

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

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

.metric-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:16px;
  background:var(--surface-2);
  border:1px solid var(--line);
}

.metric-row span{
  color:var(--muted);
}

.metric-row strong{
  color:var(--text);
  text-align:right;
}

.note-text{
  margin:0;
  color:var(--text);
  line-height:1.7;
}

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

.compare-card{
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  border-radius:22px;
  padding:20px;
  display:grid;
  gap:4px;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    background .22s ease,
    border-color .22s ease;
}
.compare-card:hover{
  background:linear-gradient(135deg);
  border-color:transparent;
  transform:scale(1.03);
  box-shadow:0 22px 45px rgba(190, 206, 190, 0.308);
  z-index:2;
}
/* Textos */
.compare-card span{
  color:var(--muted);
  font-size:18px;
  font-weight:700;
  transition:color .22s ease;
}

.compare-card strong{
  font-size:28px;
  transition:color .22s ease;
}

.compare-card p{
  margin:0;
  color:var(--muted);
  font-size:14px;
  transition:color .22s ease;
}

.compare-card span{
  color:var(--muted);
  font-size:18px;
  font-weight:700;
}

.compare-card strong{
  font-size:28px;
}

.compare-card p{
  margin:0;
  color:var(--muted);
  font-size:14px;
}

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

.photo-grid.compact{
  grid-template-columns:repeat(3, minmax(0, 1fr));
  margin-top:18px;
}

.compact-photo{
  width:100%;
  aspect-ratio:4/5;
  object-fit:cover;
  border-radius:18px;
  border:1px solid var(--line);
  background:#fff;
}

.chart-select{
  min-width:220px;
  background:#fff;
}

.checkbox-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.checkbox-grid.two-cols{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.check-card{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface-2);
  cursor:pointer;
}

.check-card input{
  width:18px;
  height:18px;
  min-height:auto;
  margin-top:2px;
}

.check-card strong{
  color:var(--text);
}

.check-card small{
  color:var(--muted);
}

@media (max-width: 980px){
  .checkbox-grid,
  .checkbox-grid.two-cols{
    grid-template-columns:1fr;
  }
}

@media (max-width: 640px){
  .chart-select{
    min-width:100%;
  }
}

@media (max-width: 1180px){
  .detail-grid,
  .before-after-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 640px){
  .comparison-metrics-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding:0px;
  }
  .compare-card{
    padding:12px;
    gap:2px;

  }
  .compare-card span{
    font-size:16px;
    font-weight:700;
  }

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

@media (max-width: 640px){
  .auth-card{
    padding:26px 20px;
    border-radius:22px;
  }

  .auth-header h1{
    font-size:28px;
  }
}

@media (max-width: 1180px){
  .stats-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .student-grid,
  .charts-grid,
  .comparison-grid,
  .photo-grid{
    grid-template-columns:1fr;
  }

  .form-grid.three,
  .form-grid.four{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .app-shell{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:relative;
    height:auto;
  }

  .main-panel{
    padding:18px;
  }

  .hero-card,
  .profile-hero,
  .page-header{
    flex-direction:column;
    align-items:flex-start;
  }
}

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

  .form-grid.two,
  .form-grid.three,
  .form-grid.four{
    grid-template-columns:1fr;
  }

  .profile-main{
    flex-direction:column;
    align-items:flex-start;
  }

  .hero-card h1,
  .page-header h1,
  .profile-hero h1{
    font-size:26px;
  }

  .stat-card strong{
    font-size:28px;
  }
}
.alert-box.success{
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
  margin-bottom:18px;
}

.inline-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.muted-line{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.row-muted{
  opacity:.72;
}

.table-check{
  width:20px;
  height:20px;
  min-height:auto;
  accent-color:var(--primary);
}

.compact-field{
  min-width:220px;
}

.compact-field input{
  min-height:46px;
}

.nutrition-table td:nth-child(2),
.nutrition-table th:nth-child(2){
  width:150px;
  text-align:center;
}

.switch-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:42px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface-2);
  cursor:pointer;
  font-weight:800;
  color:var(--secondary-2);
}

.switch-check input{
  width:20px;
  height:20px;
  min-height:auto;
  accent-color:var(--primary);
}

.switch-check:has(input:checked){
  background:#dcfce7;
  border-color:#bbf7d0;
  color:#166534;
}

@media (max-width: 640px){
  .inline-actions{
    flex-direction:column;
  }

  .compact-field{
    min-width:100%;
  }

  .nutrition-table td:nth-child(2),
  .nutrition-table th:nth-child(2){
    width:auto;
  }
}

.info-box {
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #334155;
  background: #f8fafc;
}

.info-box.soft {
  background: #ecfdf5;
  border-color: rgba(22, 163, 74, 0.18);
  color: #14532d;
}

.full-width {
  grid-column: 1 / -1;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 0.82rem;
}

.btn-danger{
  background:#dc2626;
  color:#fff;
}

.btn-danger:hover{
  background:#991b1b;
}

.alert-box.warning{
  background:#fffbeb;
  color:#92400e;
  border:1px solid #fde68a;
  margin-bottom:18px;
}

.btn-sm{
  min-height:36px;
  padding:0 12px;
  border-radius:12px;
  font-size:13px;
}

.danger-zone{
  border-color:#fecaca;
}

/* =========================================================
   MONKEYFIT responsive redesign
   Color principal solicitado: #6d7767
   ========================================================= */
:root{
  --primary:#6d7767;
  --primary-2:#596254;
  --primary-3:#475044;
  --primary-soft:#edf1e8;
  --primary-soft-2:#f6f8f3;
  --cream:#f6f3e8;
  --ink:#202620;
  --sidebar-collapsed:88px;
  --sidebar-expanded:282px;
}

body.sidebar-lock{
  overflow:hidden;
}

/* Auth/login */
.monkey-auth-page{
  min-height:100vh;
  padding:0;
  display:block;
  background:#f7f8f5;
}

.auth-split{
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr;
}

.auth-brand-panel{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(34px, 5vw, 80px);
  color:#fff;
  background:
    linear-gradient(135deg, rgba(109,119,103,.96), rgba(71,80,68,.98)),
    url('/img/auth-pattern.svg');
  background-size:auto, 360px 360px;
}

.auth-brand-panel::before,
.auth-brand-panel::after{
  content:"";
  position:absolute;
  border-radius:999px;
  background:rgba(246,243,232,.12);
  filter:blur(.2px);
}

.auth-brand-panel::before{
  width:340px;
  height:340px;
  left:-120px;
  top:-90px;
}

.auth-brand-panel::after{
  width:420px;
  height:420px;
  right:-160px;
  bottom:-140px;
}

.auth-brand-content{
  position:relative;
  z-index:1;
  width:min(500px, 100%);
  display:grid;
  justify-items:center;
  align-content:center;
  text-align:center;
  gap:28px;
}

.auth-logo{
  width:180px;
  height:180px;
  border-radius:34px;
  object-fit:contain;
  margin-inline:auto;
  /*background:rgba(255,255,255,.0);
  box-shadow:0 24px 80px rgba(0,0,0,.0);*/
}

.auth-kicker{
  display:inline-flex;
  width:max-content;
  min-height:34px;
  align-items:center;
  padding:0 14px;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:rgba(255,255,255,.86);
  font-weight:800;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.auth-brand-content h1{
  margin:18px 0 0;
  font-size:clamp(42px, 5.4vw, 76px);
  line-height:.95;
  letter-spacing:-.06em;
}

.auth-brand-content p{
  max-width:480px;
  margin:20px 0 0;
  color:rgba(255,255,255,.82);
  font-size:18px;
  line-height:1.7;
}

.auth-form-panel{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at top right, rgba(109,119,103,.12), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f6f8f3 100%);
}

.auth-card-modern{
  max-width:460px;
  border-radius:32px;
  padding:38px;
  border:1px solid rgba(109,119,103,.16);
  box-shadow:0 30px 90px rgba(32,38,32,.12);
}

.auth-card-modern .auth-header h2{
  margin:0;
  font-size:34px;
  line-height:1.1;
  letter-spacing:-.03em;
  color:var(--ink);
}

.auth-card-modern input{
  min-height:54px;
  border-radius:18px;
  border-color:#d8dfd3;
  background:#fbfcf9;
}

.auth-card-modern input:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(109,119,103,.12);
}

/* App shell/sidebar */
.app-shell{
  grid-template-columns:var(--sidebar-collapsed) 1fr;
  transition:grid-template-columns .22s ease;
}

.app-shell.sidebar-expanded{
  grid-template-columns:var(--sidebar-expanded) 1fr;
}

.mobile-topbar,
.sidebar-backdrop{
  display:none;
}

.sidebar{
  width:var(--sidebar-collapsed);
  padding:18px 14px;
  gap:18px;
  background:linear-gradient(180deg, var(--primary) 0%, var(--primary-3) 100%);
  border-right:1px solid rgba(255,255,255,.12);
  transition:width .22s ease, transform .22s ease;
  overflow:hidden;
  z-index:30;
}

.app-shell.sidebar-expanded .sidebar{
  width:var(--sidebar-expanded);
}

.sidebar-toggle{
  width:46px;
  height:46px;
  border:1px solid rgba(255,255,255,.20);
  border-radius:16px;
  background:rgba(255,255,255,.10);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  cursor:pointer;
  transition:.2s ease;
}

.sidebar-toggle:hover{
  background:rgba(255,255,255,.18);
}

.sidebar-toggle span{
  width:20px;
  height:2px;
  border-radius:999px;
  background:currentColor;
  display:block;
}

.brand-sidebar{
  min-height:58px;
  padding:7px 0;
  align-items:center;
  color:#fff;
}

.brand-logo{
  width:58px;
  height:58px;
  min-width:58px;
  border-radius:20px;
  background:rgba(255,255,255,.14);
  padding:7px;
}

.brand-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.brand-copy,
.nav-text,
.mini-user,
.sidebar-footer .btn .nav-text{
  opacity:0;
  transform:translateX(-8px);
  pointer-events:none;
  white-space:nowrap;
  transition:.18s ease;
}

.app-shell.sidebar-expanded .brand-copy,
.app-shell.sidebar-expanded .nav-text,
.app-shell.sidebar-expanded .mini-user,
.app-shell.sidebar-expanded .sidebar-footer .btn .nav-text{
  opacity:1;
  transform:none;
  pointer-events:auto;
}

.brand-copy strong,
.brand-copy small{
  display:block;
}

.brand-copy strong{
  font-size:16px;
  letter-spacing:-.03em;
}

.brand-copy small{
  color:rgba(255,255,255,.66);
  font-size:11px;
  letter-spacing:.10em;
  font-weight:800;
}

.nav-menu{
  gap:10px;
}

.nav-link{
  min-height:50px;
  padding:0 13px;
  border-radius:18px;
  gap:13px;
  justify-content:flex-start;
}

.nav-link:hover,
.nav-link.active{
  background:rgba(255,255,255,.16);
}

.nav-icon{
  width:24px;
  min-width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  line-height:1;
}
.nav-icon-img{
  width:22px;
  height:22px;
  object-fit:contain;
  display:block;
  filter:brightness(0) invert(1);
}
.nav-icon-img2{
  width:22px;
  height:22px;
  object-fit:contain;
  display:block;
  filter:brightness(0) invert(1);
}

.sidebar-footer .btn{
  padding:0 13px;
  justify-content:flex-start;
  background:rgba(17,24,39,.44);
}

.sidebar-footer{
  gap:12px;
}

.mini-user{
  min-width:220px;
  background:rgba(255,255,255,.10);
}

.main-panel{
  min-width:0;
  padding:28px clamp(18px, 3vw, 34px);
}

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

.btn-primary:hover{
  background:var(--primary-2);
}

.eyebrow{
  background:var(--primary-soft);
  color:var(--primary-2);
}

.text-link{
  color:var(--primary-2);
}

.avatar-circle,
.avatar-xl{
  background:linear-gradient(180deg, #edf1e8 0%, #dfe8d7 100%);
  color:var(--primary-3);
}

.table-check,
.switch-check input{
  accent-color:var(--primary);
}

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

  .auth-brand-panel{
    min-height:40vh;
    padding:34px 24px;
    text-align:center;
  }

  .auth-brand-content{
    justify-items:center;
    gap:16px;
  }

  .auth-logo{
    width:94px;
    height:94px;
    border-radius:28px;
  }

  .auth-brand-content h1{
    font-size:clamp(32px, 9vw, 50px);
  }

  .auth-brand-content p{
    margin-top:12px;
    font-size:15px;
  }

  .auth-form-panel{
    align-items:flex-start;
    padding:24px 18px 34px;
  }

  .auth-card-modern{
    max-width:560px;
    padding:28px 22px;
    border-radius:26px;
  }

  .app-shell,
  .app-shell.sidebar-expanded{
    display:block;
    grid-template-columns:1fr;
    padding-top:70px;
  }

  .mobile-topbar{
    position:fixed;
    inset:0 0 auto 0;
    height:70px;
    z-index:40;
    display:grid;
    grid-template-columns:56px 1fr 56px;
    align-items:center;
    padding:0 12px;
    background:linear-gradient(90deg, var(--primary) 0%, var(--primary-3) 100%);
    box-shadow:0 12px 28px rgba(32,38,32,.18);
  }

  .mobile-menu-btn{
    width:46px;
    height:46px;
  }

  .mobile-brand{
    justify-self:center;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .mobile-brand img{
    width:48px;
    height:48px;
  }

  .sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:282px;
    height:100vh;
    transform:translateX(-105%);
    padding:18px 16px;
    overflow-y:auto;
  }

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

  .app-shell.sidebar-open .sidebar-backdrop{
    display:block;
    position:fixed;
    inset:0;
    z-index:20;
    background:rgba(15,23,15,.42);
    backdrop-filter:blur(2px);
  }

  .desktop-menu-btn{
    display:none;
  }

  .brand-copy,
  .nav-text,
  .mini-user,
  .sidebar-footer .btn .nav-text{
    opacity:1;
    transform:none;
    pointer-events:auto;
  }

  .main-panel{
    padding:18px;
  }

  .data-table th,
  .data-table td{
    padding:12px 10px;
  }
}

@media (max-width: 640px){
  .auth-brand-panel{
    min-height:36vh;
  }

  .nav-icon-img2{
  width:17px;
  height:17px;
  object-fit:contain;
  display:block;
  filter:brightness(0) invert(1);
}

  .auth-form-panel{
    padding:20px 14px 28px;
  }

  .auth-card-modern .auth-header h2{
    font-size:28px;
  }

  .page-header,
  .hero-card,
  .profile-hero,
  .section-card{
    border-radius:20px;
    padding:20px;
  }

  .hero-actions,
  .actions-row,
  .toolbar{
    width:100%;
    flex-direction:column;
    align-items:stretch;
  }

  .hero-actions .btn,
  .actions-row .btn,
  .toolbar .btn{
    width:100%;
  }

  .student-card{
    grid-template-columns:auto 1fr;
  }

  .student-card .status-pill{
    grid-column:1 / -1;
    justify-self:start;
  }
}

/* =========================================================
   Clean dashboard and compact lists
   ========================================================= */
.dashboard-clean{
  align-content:start;
}

.compact-page-header{
  padding:18px 22px;
  align-items:center;
}

.compact-page-header h1,
.compact-section-header h1{
  margin:6px 0 0;
  font-size:24px;
  line-height:1.15;
}

.compact-page-header p,
.compact-section-header p{
  margin-top:6px;
}

.compact-section-header{
  margin-bottom:16px;
  align-items:center;
}

.quick-actions-card{
  padding:20px;
}

.quick-actions-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.quick-action-btn{
  min-height:104px;
  padding:20px;
  border-radius:22px;
  border:1px solid var(--line);
  background:var(--primary);
  display:grid;
  gap:6px;
  align-content:center;
  transition:.18s ease;
}

.quick-action-btn:hover{
  transform:translateY(-2px);
  border-color:rgba(109,119,103,.30);
  box-shadow:0 18px 38px rgba(32,38,32,.08);
}

.quick-action-btn.featured{
  background:linear-gradient(135deg, var(--primary), var(--primary-3));
  color:#fff;
  border-color:transparent;
}

.quick-action-icon{
  width:24px;
  height:24px;
  border-radius:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  /*background:rgba(109,119,103,.12);*/
  color:var(--primary-3);
  font-size:22px;
  font-weight:900;
}

.quick-action-btn.featured .quick-action-icon{
  background:rgba(255,255,255,.16);
  color:#fff;
}

.quick-action-btn strong{
  font-size:18px;
  color:#fff;

}

.quick-action-btn small{
  color:var(--muted);
}

.quick-action-btn.featured small{
  color:rgba(255,255,255,.72);
}

.compact-stats-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.compact-stat-card{
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  border-radius:20px;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:4px;
}

.compact-stat-card span{
  color:var(--muted);
  font-size:14px;
  font-weight:700;
}

.compact-stat-card strong{
  font-size:28px;
  line-height:1;
}

.compact-list-section{
  padding:20px;
}

.live-search-wrap{
  margin-bottom:14px;
}

.live-search-input{
  min-height:48px;
  border-radius:16px;
  background:#fbfcf9;
}

.clean-list{
  display:grid;
  gap:10px;
  max-height:none;
}

.single-column-list{
  grid-template-columns:1fr;
}

.clean-list-row{
  display:grid;
  grid-template-columns:minmax(240px, 1.25fr) minmax(150px, .75fr) minmax(120px, .5fr) minmax(160px, .7fr);
  gap:14px;
  align-items:center;
  min-height:72px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  transition:.16s ease;
}

.clean-list-row:hover{
  border-color:rgba(109,119,103,.34);
  box-shadow:0 14px 30px rgba(32,38,32,.06);
  transform:translateY(-1px);
}

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

.row-main strong,
.row-meta strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
}

.row-main small,
.row-meta small,
.row-meta span{
  color:var(--muted);
  font-size:12px;
}

.row-meta{
  display:grid;
  gap:4px;
  min-width:0;
}

.row-meta.stacked{
  justify-items:start;
}

.row-meta.wide-meta{
  min-width:0;
}

.admin-list-row{
  grid-template-columns:minmax(230px, 1.1fr) minmax(130px, .6fr) minmax(210px, 1fr) minmax(150px, .7fr);
}

.student-list-row{
  grid-template-columns:minmax(240px, 1.25fr) minmax(150px, .75fr) minmax(120px, .5fr) minmax(160px, .7fr);
}

.select-row{
  grid-template-columns:minmax(240px, 1.2fr) minmax(150px, .7fr) minmax(220px, 1fr);
}

.reto-list-row{
  grid-template-columns:minmax(260px, 1.3fr) minmax(190px, .9fr) minmax(130px, .55fr) minmax(150px, .65fr);
}

.reto-avatar{
  background:linear-gradient(180deg, var(--primary-soft) 0%, #dfe8d7 100%);
}

.compact-empty{
  min-height:160px;
}

.hidden-by-search{
  display:none !important;
}

@media (max-width: 980px){
  .quick-actions-grid,
  .compact-stats-grid{
    grid-template-columns:repeat(1, minmax(0, 1fr));
  }

  .clean-list-row,
  .admin-list-row,
  .student-list-row,
  .select-row,
  .reto-list-row{
    grid-template-columns:1fr;
    align-items:start;
  }

  .row-meta{
    padding-left:54px;
  }

  .row-meta.stacked{
    padding-left:54px;
  }

  .compact-page-header{
    align-items:flex-start;
  }
}

@media (max-width: 640px){
  .compact-page-header,
  .quick-actions-card,
  .compact-list-section{
    padding:16px;
  }

  .compact-page-header h1,
  .compact-section-header h1{
    font-size:22px;
  }

  .quick-action-btn{
    min-height:88px;
    border-radius:18px;
    padding:16px;
  }

  .compact-stat-card{
    padding:14px 16px;
  }

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

  .clean-list-row{
    border-radius:16px;
  }
}


/* =========================================================
   Ajustes dashboard compacto + scroll horizontal móvil
   ========================================================= */
.quick-actions-card{
  padding:18px 20px;
}

.quick-actions-grid{
  gap:12px;
}

.quick-action-btn{
  min-height:76px;
  padding:12px 16px;
  border-radius:18px;
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-rows:auto auto;
  column-gap:12px;
  row-gap:2px;
  align-content:center;
  align-items:center;
}

.quick-action-icon{
  width:34px;
  height:34px;
  border-radius:13px;
  font-size:18px;
  grid-row:1 / span 2;
}

.quick-action-btn strong{
  font-size:16px;
  line-height:1.15;
}

.quick-action-btn small{
  font-size:13px;
  line-height:1.2;
}

.dashboard-clean .student-list-row{
  grid-template-columns:minmax(280px, 1.15fr) minmax(160px, .55fr) minmax(150px, .45fr);
}

@media (max-width: 980px){
  .dashboard-clean .clean-list{
    display:grid;
    overflow-x:visible;
    overflow-y:visible;
    padding-bottom:8px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }

  .dashboard-clean .clean-list::after{
    /*content:"Desliza a la derecha para ver más";*/
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }

  .dashboard-clean .clean-list-row,
  .dashboard-clean .student-list-row{
    width:100%;
    min-width:650px;
    grid-template-columns:minmax(280px, 1.15fr) minmax(160px, .55fr) minmax(150px, .45fr);
    align-items:center;
    margin-bottom:10px;
  }

  .dashboard-clean .row-meta,
  .dashboard-clean .row-meta.stacked{
    padding-left:0;
  }

  .dashboard-clean .row-main strong,
  .dashboard-clean .row-main small,
  .dashboard-clean .row-meta span,
  .dashboard-clean .row-meta small,
  .dashboard-clean .row-meta strong{
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .quick-actions-card{
    padding:8px;
  }

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

  .quick-action-btn{
    min-height:64px;
    padding:10px 12px;
    border-radius:16px;
  }

  .quick-action-icon{
    width:30px;
    height:30px;
    border-radius:11px;
    font-size:10px;
  }

  .quick-action-btn strong{
    font-size:14px;
  }

  .quick-action-btn small{
    font-size:12px;
  }

  .dashboard-clean .clean-list-row,
  .dashboard-clean .student-list-row{
    min-height:64px;
    padding:10px 12px;
    border-radius:14px;
    min-width:620px;
  }

  .dashboard-clean .avatar-circle.small{
    width:40px;
    height:40px;
    border-radius:14px;
  }
}

/* =========================================================
   Correcciones sidebar móvil + hover desktop + headers compactos
   ========================================================= */
@media (min-width: 901px){
  .app-shell:not(.sidebar-pinned) .sidebar:hover{
    width:var(--sidebar-expanded);
    box-shadow:22px 0 50px rgba(32,38,32,.16);
  }

  .app-shell:not(.sidebar-pinned) .sidebar:hover .brand-copy,
  .app-shell:not(.sidebar-pinned) .sidebar:hover .nav-text,
  .app-shell:not(.sidebar-pinned) .sidebar:hover .mini-user,
  .app-shell:not(.sidebar-pinned) .sidebar:hover .sidebar-footer .btn .nav-text{
    opacity:1;
    transform:none;
    pointer-events:auto;
  }

  .app-shell.sidebar-pinned{
    grid-template-columns:var(--sidebar-expanded) 1fr;
  }

  .app-shell.sidebar-pinned .sidebar{
    width:var(--sidebar-expanded);
  }
}

/* Header compacto para listas como Nutricionistas, Alumnos, Retos */
.compact-page-header{
  padding:14px 18px !important;
  min-height:unset !important;
  align-items:center !important;
  border-radius:18px !important;
  gap:14px !important;
}

.compact-page-header .eyebrow{
  padding:5px 10px;
  font-size:11px;
}

.compact-page-header h1{
  margin:5px 0 0 !important;
  font-size:24px !important;
  line-height:1.1 !important;
}

.compact-page-header p{
  margin:5px 0 0 !important;
  line-height:1.35 !important;
  font-size:14px !important;
}

.compact-page-header .btn{
  min-height:40px;
  border-radius:14px;
  padding:0 14px;
}

@media (max-width: 900px){
  .mobile-topbar{
    z-index:1000 !important;
  }

  .app-shell.sidebar-open .mobile-topbar{
    z-index:1000 !important;
  }

  .sidebar{
    z-index:1250 !important;
    top:0 !important;
    bottom:auto !important;
    height:100dvh !important;
    max-height:100dvh !important;
    padding-top:18px !important;
    padding-bottom:max(110px, calc(env(safe-area-inset-bottom) + 110px)) !important;
    box-shadow:22px 0 55px rgba(15,23,15,.28);
  }

  .app-shell.sidebar-open .sidebar-backdrop{
    z-index:1200 !important;
  }

  .sidebar-footer{
    margin-top:18px !important;
    padding-bottom:0 !important;
  }

  .sidebar-footer .logout-link{
    order:-2;
  }

  .sidebar-footer .mini-user{
    order:-1;
  }

  .nav-menu{
    flex:0 0 auto;
  }

  .compact-page-header{
    padding:14px 16px !important;
    flex-direction:row !important;
    align-items:center !important;
  }

  .compact-page-header h1{
    font-size:22px !important;
  }

  .compact-page-header p{
    font-size:13px !important;
  }
}

@media (max-width: 640px){
  .compact-page-header{
    flex-direction:column !important;
    align-items:flex-start !important;
    padding:12px 14px !important;
  }

  .compact-page-header .btn{
    width:100%;
  }
}
.main-panel{
  align-content:start !important;
  grid-auto-rows:max-content;
}

/* Evita que toda la página tenga scroll horizontal */
html,
body{
  max-width:100%;
  overflow-x:hidden;
}

.app-shell,
.main-panel,
.section-card,
.compact-list-section{
  min-width:0;
}

/* En escritorio la lista funciona normal */
.students-scroll-x{
  width:100%;
  max-width:100%;
}

/* En celular, solo esta sección tendrá scroll horizontal */
@media (max-width: 980px){
  .students-scroll-x{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    padding-bottom:8px;
  }

  .students-scroll-x::after{
    content:"Desliza a la derecha para ver más";
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }

  .students-scroll-x .latest-students-list{
    display:block !important;
    width:max-content;
    min-width:100%;
    overflow:visible !important;
  }

  .students-scroll-x .student-list-row{
    width:650px !important;
    min-width:650px !important;
    max-width:none !important;
    grid-template-columns:minmax(280px, 1.15fr) minmax(160px, .55fr) minmax(150px, .45fr);
    align-items:center;
    margin-bottom:10px;
  }

  .students-scroll-x .row-meta,
  .students-scroll-x .row-meta.stacked{
    padding-left:0 !important;
  }

  .students-scroll-x .row-main strong,
  .students-scroll-x .row-main small,
  .students-scroll-x .row-meta span,
  .students-scroll-x .row-meta small,
  .students-scroll-x .row-meta strong{
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .students-scroll-x .student-list-row{
    width:620px !important;
    min-width:620px !important;
  }
}

/* Botones rápidos más compactos */
.quick-action-compact{
  min-height:54px !important;
  padding:10px 14px !important;
  border-radius:16px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:left !important;
  gap:0px !important;
}

.quick-action-compact .quick-action-icon{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  border-radius:10px !important;
  font-size:17px !important;
  grid-row:auto !important;
}

.quick-action-compact strong{
  font-size:15px !important;
  line-height:1 !important;
  white-space:nowrap;
}

.quick-action-compact small{
  display:none !important;
}
@media (max-width: 640px){
  .quick-action-compact{
    min-height:48px !important;
    padding:9px 12px !important;
    justify-content:flex-start !important;
  }

  .quick-action-compact .quick-action-icon{
    width:26px !important;
    height:26px !important;
    min-width:26px !important;
    font-size:16px !important;
  }

  .quick-action-compact strong{
    font-size:14px !important;
  }
}
/* =========================================================
   Alumno: perfil limpio, KPIs, historial scroll móvil y gráficos modernos
   ========================================================= */
.student-profile-page{
  align-content:start;
  gap:18px;
}

.student-profile-hero{
  padding:20px;
  align-items:center;
}

.student-profile-hero .avatar-xl{
  width:84px;
  height:84px;
  border-radius:24px;
  flex:0 0 auto;
}

.profile-summary-copy h1{
  margin:6px 0 0;
  font-size:28px;
  line-height:1.08;
  letter-spacing:-.03em;
}

.profile-summary-copy .hero-text{
  margin-top:6px;
  line-height:1.4;
}

.compact-meta-pills{
  margin-top:10px;
  gap:8px;
}

.compact-meta-pills .meta-pill,
.compact-meta-pills .status-pill{
  min-height:28px;
  padding:0 10px;
  font-size:12px;
}

.compact-profile-actions{
  justify-content:flex-end;
  max-width:520px;
}

.compact-profile-actions .btn{
  min-height:40px;
  border-radius:14px;
  padding:0 13px;
  font-size:13px;
}

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

.student-kpi-card{
  min-height:78px;
  padding:14px 16px;
}

.student-kpi-card span{
  font-size:13px;
}

.student-kpi-card strong{
  font-size:24px;
}

.evaluation-history-card{
  padding:18px 20px;
}

.evaluation-table-scroll{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}

.clean-evaluation-table{
  min-width:760px;
  border-collapse:separate;
  border-spacing:0 8px;
}

.clean-evaluation-table th{
  border-bottom:0;
  padding:0 14px 6px;
  font-size:12px;
}

.clean-evaluation-table td{
  border-bottom:0;
  background:#f1f7f2;
  padding:13px 14px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.clean-evaluation-table td:first-child{
  border-left:1px solid var(--line);
  border-radius:16px 0 0 16px;
}

.clean-evaluation-table td:last-child{
  border-right:1px solid var(--line);
  border-radius:0 16px 16px 0;
}

.clickable-table-row{
  cursor:pointer;
  transition:.16s ease;
}

.clickable-table-row:hover td,
.clickable-table-row:focus td{
  border-color:rgba(109,119,103,.36);
  background:#b4c9b0;
}

.clickable-table-row:focus{
  outline:none;
}

.modern-charts-grid{
  align-items:stretch;
}

.modern-chart-card{
  padding:18px;
  overflow:hidden;
}

.chart-card-header{
  margin-bottom:12px;
}

.chart-card-header h2{
  font-size:20px;
}

.chart-card-header p{
  line-height:1.35;
}

.modern-chart-select{
  min-width:190px;
  min-height:42px;
  border-radius:14px;
  background:#fbfcf9;
}

.chart-canvas-panel{
  height:300px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:22px;
  background:linear-gradient(180deg, #fff 0%, #fbfcf9 100%);
}

.chart-canvas-panel canvas{
  height:100% !important;
}

@media (max-width:1180px){
  .student-kpi-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .student-profile-hero{
    align-items:flex-start;
  }

  .compact-profile-actions{
    max-width:none;
    justify-content:flex-start;
  }
}

@media (max-width:900px){
  .student-profile-hero{
    padding:18px;
  }

  .profile-summary-copy h1{
    font-size:24px;
  }

  .evaluation-table-scroll::after{
    content:"Desliza a la derecha para ver más";
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }
}

@media (max-width:640px){
  .student-profile-page{
    gap:14px;
  }

  .student-profile-hero{
    padding:16px;
  }

  .student-profile-hero .profile-main{
    flex-direction:row;
    align-items:center;
    gap:12px;
  }

  .student-profile-hero .avatar-xl{
    width:64px;
    height:64px;
    border-radius:20px;
  }

  .profile-summary-copy h1{
    font-size:21px;
  }

  .profile-summary-copy .hero-text{
    font-size:13px;
  }

  .compact-meta-pills{
    gap:6px;
  }

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

  .student-kpi-card{
    min-height:68px;
    padding:12px;
    align-items:flex-start;
    flex-direction:column;
  }

  .student-kpi-card strong{
    font-size:22px;
  }

  .evaluation-history-card,
  .modern-chart-card{
    padding:14px;
  }

  .clean-evaluation-table{
    min-width:700px;
  }

  .clean-evaluation-table td{
    padding:11px 12px;
  }

  .chart-card-header{
    align-items:flex-start;
  }

  .modern-chart-select{
    width:100%;
    min-width:10%;
  }

  .chart-canvas-panel{
    height:260px;
    padding:8px;
    border-radius:18px;
  }

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

  .compact-profile-actions .btn,
  .compact-profile-actions form{
    width:100%;
  }
}

.comparison-table-card{
  padding:20px;
}

.comparison-table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.comparison-table{
  width:100%;
  min-width:680px;
  border-collapse:separate;
  border-spacing:1;
}

.comparison-table th,
.comparison-table td{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:middle;
}

.comparison-table th{
  color:var(--muted);
  font-size:16px;
  font-weight:500;
  text-transform:uppercase;

  background:var(--primary-soft-2);
}

.comparison-table th:first-child{
  border-top-left-radius:16px;
}

.comparison-table th:last-child{
  border-top-right-radius:16px;
}

.comparison-table td:first-child{
  font-weight:600;
  color:var(--text);
  width:0px;
}

.measurement-column{
  width:150px;
}

.measurement-head{
  display:grid;
  gap:6px;
  align-items:start;
}

.measurement-head strong{
  color:var(--text);
  font-size:16px;
  text-transform:none;
}

.measurement-head span{
  color:var(--muted);
  font-size:16px;
  font-weight:700;
}

.measurement-head .btn{
  width:max-content;
  margin-top:4px;
}

.comparison-cell-link{
  display:block;
  width:100%;
  min-height:32px;
  padding:6px 8px;
  border-radius:10px;
  color:var(--text);
  font-weight:100;
}



@media (max-width: 640px){
  .comparison-table-card{
    padding:16px;
  }

  .comparison-table{
    min-width:110px;
  }

  .comparison-table th,
  .comparison-table td{
    padding:6px;
  }

  .measurement-column{
    width:320px;
  }
}



.delta-text{
  display:flex;
  align-items:center;
  gap:8px;
}

.delta-arrow{
  width:22px;
  height:22px;
  min-width:22px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  font-weight:100;
  line-height:1px;
  font-family:Arial Black, Arial, sans-serif;
  text-shadow:0 0 1px currentColor;
}

.delta-arrow.arrow-good{
  color:#16a34a;
}

.delta-arrow.arrow-bad{
  color:#dc2626;
}


/* =========================================================
   Lista de alumnos con scroll horizontal en móvil
   ========================================================= */

.alumnos-scroll-x{
  width:100%;
  max-width:100%;
}

@media (max-width: 980px){
  .alumnos-scroll-x{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    padding-bottom:8px;
  }

  .alumnos-scroll-x::after{
    content:"Desliza a la derecha para ver más";
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }

  .alumnos-scroll-x .alumnos-list-scroll{
    display:block !important;
    width:max-content;
    min-width:100%;
    overflow:visible !important;
  }

  .alumnos-scroll-x .student-list-row{
    width:760px !important;
    min-width:760px !important;
    max-width:none !important;
    display:grid !important;
    grid-template-columns:minmax(280px, 1.25fr) minmax(170px, .75fr) minmax(130px, .5fr) minmax(190px, .7fr) !important;
    align-items:center !important;
    margin-bottom:10px;
  }

  .alumnos-scroll-x .row-meta,
  .alumnos-scroll-x .row-meta.stacked{
    padding-left:0 !important;
  }

  .alumnos-scroll-x .row-main strong,
  .alumnos-scroll-x .row-main small,
  .alumnos-scroll-x .row-meta span,
  .alumnos-scroll-x .row-meta small,
  .alumnos-scroll-x .row-meta strong{
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .alumnos-scroll-x .student-list-row{
    width:720px !important;
    min-width:780px !important;
    min-height:64px;
    padding:8px 8px;
    border-radius:14px;
  }

  .alumnos-scroll-x .avatar-circle.small{
    width:40px;
    height:40px;
    border-radius:14px;
  }
}

/* =========================================================
   Dashboard portal alumno - versión limpia sin afectar admin
   ========================================================= */
.alumno-dashboard-page{
  align-content:start;
  gap:18px;
}

.alumno-welcome-card{
  padding:18px 20px;
}

.alumno-dashboard-header{
  margin-bottom:14px;
}

.alumno-welcome-main{
  align-items:center;
}

.alumno-dashboard-avatar{
  width:48px;
  height:48px;
  min-width:48px;
  border-radius:16px;
}

.alumno-dashboard-avatar span{
  font-size:18px;
}

.alumno-quick-actions-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.quick-action-disabled{
  opacity:.58;
  cursor:not-allowed;
  filter:grayscale(.15);
}

.quick-action-disabled:hover{
  transform:none !important;
  box-shadow:none !important;
}

.alumno-kpi-grid{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}

.alumno-kpi-grid .compact-stat-card{
  min-height:74px;
}

.alumno-kpi-grid .compact-stat-card strong{
  font-size:24px;
}

.alumno-evaluations-scroll-x{
  width:100%;
  max-width:100%;
}

.alumno-evaluation-row{
  grid-template-columns:minmax(220px, 1.15fr) minmax(100px, .5fr) minmax(90px, .45fr) minmax(110px, .5fr) minmax(90px, .4fr) minmax(90px, .4fr);
}

.alumno-eval-icon{
  background:linear-gradient(180deg, var(--primary-soft) 0%, #dfe8d7 100%);
  color:var(--primary-3);
}

@media (max-width: 1180px){
  .alumno-kpi-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px){
  .alumno-quick-actions-grid{
    grid-template-columns:1fr;
  }

  .alumno-evaluations-scroll-x{
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    padding-bottom:8px;
  }

  .alumno-evaluations-scroll-x::after{
    content:"Desliza a la derecha para ver más";
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }

  .alumno-evaluations-scroll-x .alumno-evaluations-list{
    display:block !important;
    width:max-content;
    min-width:100%;
    overflow:visible !important;
  }

  .alumno-evaluations-scroll-x .alumno-evaluation-row{
    width:760px !important;
    min-width:760px !important;
    max-width:none !important;
    display:grid !important;
    grid-template-columns:minmax(220px, 1.15fr) minmax(100px, .5fr) minmax(90px, .45fr) minmax(110px, .5fr) minmax(90px, .4fr) minmax(90px, .4fr) !important;
    align-items:center !important;
    margin-bottom:10px;
  }

  .alumno-evaluations-scroll-x .row-meta,
  .alumno-evaluations-scroll-x .row-meta.stacked{
    padding-left:0 !important;
  }

  .alumno-evaluations-scroll-x .row-main strong,
  .alumno-evaluations-scroll-x .row-main small,
  .alumno-evaluations-scroll-x .row-meta span,
  .alumno-evaluations-scroll-x .row-meta small,
  .alumno-evaluations-scroll-x .row-meta strong{
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .alumno-welcome-card{
    padding:14px;
  }

  .alumno-dashboard-header{
    margin-bottom:10px;
  }

  .alumno-welcome-main{
    align-items:center;
  }

  .alumno-dashboard-avatar{
    width:42px;
    height:42px;
    min-width:42px;
    border-radius:14px;
  }

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

  .alumno-kpi-grid .compact-stat-card{
    min-height:68px;
    padding:12px;
    align-items:flex-start;
    flex-direction:column;
  }

  .alumno-kpi-grid .compact-stat-card span{
    font-size:12px;
  }

  .alumno-kpi-grid .compact-stat-card strong{
    font-size:21px;
  }

  .alumno-evaluations-scroll-x .alumno-evaluation-row{
    width:720px !important;
    min-width:720px !important;
    min-height:64px;
    padding:10px 12px;
    border-radius:14px;
  }
}

.inline-name{
  display:inline !important;
}

/* =========================================================
   Password visibility toggle - Login / Crear contraseña
   ========================================================= */
.password-input-wrap{
  position:relative;
  width:100%;
}

.password-input-wrap input{
  padding-right:56px !important;
}

.password-toggle-btn{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:38px;
  height:38px;
  min-height:38px;
  padding:0;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--primary-2);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  line-height:1;
  font-size:18px;
  transition:background .18s ease, color .18s ease, transform .18s ease;
}

.password-toggle-btn:hover{
  background:var(--primary-soft);
  color:var(--primary-3);
  transform:translateY(-50%) scale(1.02);
}

.password-toggle-btn:focus-visible{
  outline:3px solid rgba(109,119,103,.22);
  outline-offset:2px;
}

.password-toggle-btn .icon-hide{
  display:none;
}

.password-toggle-btn.is-visible .icon-show{
  display:none;
}

.password-toggle-btn.is-visible .icon-hide{
  display:inline;
}

.auth-card-modern .password-input-wrap input{
  padding-right:58px !important;
}

@media (max-width:640px){
  .password-toggle-btn{
    width:36px;
    height:36px;
    min-height:36px;
    right:7px;
  }
}

/* =========================================================
   Formulario evaluación: campos obligatorios + fecha móvil
   ========================================================= */
.required-mark{
  color:var(--danger);
  font-weight:900;
  margin-left:3px;
}

.evaluation-form-page,
.evaluation-form-page .section-card,
.evaluation-form-page .form-section,
.evaluation-form-page .form-grid,
.evaluation-form-page .form-field{
  min-width:0;
}

.evaluation-date-field input[type="date"]{
  width:100%;
  max-width:100%;
  min-width:0;
}

@media (max-width:640px){
  .evaluation-form-page input[type="date"]{
    width:100%;
    max-width:100%;
    min-width:0;
    display:block;
    -webkit-appearance:none;
    appearance:none;
    padding-left:12px;
    padding-right:12px;
  }

  .evaluation-form-page .form-grid.three,
  .evaluation-form-page .form-grid.four,
  .evaluation-form-page .form-grid.two{
    grid-template-columns:minmax(0, 1fr) !important;
  }
}

/* =========================================================
   Nueva evaluación: selector de alumno con scroll horizontal móvil
   Se deja al final para ganar a las reglas generales de .select-row
   ========================================================= */

.select-student-scroll-x{
  width:100%;
  max-width:100%;
  min-width:0;
}

.select-student-list-scroll{
  width:100%;
  min-width:0;
}

@media (max-width: 980px){
  .select-student-scroll-x{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    padding-bottom:8px;
  }

  .select-student-scroll-x::after{
    content:"Desliza a la derecha para ver más";
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }

  .select-student-scroll-x .select-student-list-scroll{
    display:block !important;
    width:max-content !important;
    min-width:100% !important;
    max-width:none !important;
    overflow:visible !important;
  }

  .select-student-scroll-x .select-row{
    width:760px !important;
    min-width:760px !important;
    max-width:none !important;
    display:grid !important;
    grid-template-columns:minmax(300px, 1.2fr) minmax(170px, .7fr) minmax(250px, 1fr) !important;
    align-items:center !important;
    gap:14px !important;
    margin-bottom:10px;
  }

  .select-student-scroll-x .row-main{
    min-width:0;
  }

  .select-student-scroll-x .row-meta,
  .select-student-scroll-x .row-meta.stacked,
  .select-student-scroll-x .row-meta.wide-meta{
    padding-left:0 !important;
    min-width:0;
  }

  .select-student-scroll-x .row-main strong,
  .select-student-scroll-x .row-main small,
  .select-student-scroll-x .row-meta span,
  .select-student-scroll-x .row-meta small,
  .select-student-scroll-x .row-meta strong{
    white-space:nowrap !important;
  }
}

@media (max-width: 640px){
  .select-student-scroll-x .select-row{
    width:720px !important;
    min-width:720px !important;
    min-height:64px;
    padding:10px 12px;
    border-radius:14px;
    grid-template-columns:minmax(280px, 1.15fr) minmax(155px, .65fr) minmax(230px, .95fr) !important;
  }

  .select-student-scroll-x .avatar-circle.small{
    width:40px;
    height:40px;
    border-radius:14px;
  }
}


/* =========================================================
   Retos: añadir usuarios con búsqueda en vivo + selección persistente
   ========================================================= */
.add-users-card{
  display:grid;
  gap:16px;
}

.add-users-live-toolbar{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:12px;
  align-items:center;
  margin-bottom:2px;
}

.add-users-search-wrap{
  margin-bottom:0 !important;
}

.add-users-counter-card{
  min-height:48px;
  min-width:160px;
  padding:8px 14px;
  border-radius:16px;
  background:var(--primary-soft-2);
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}

.add-users-counter-card span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.add-users-counter-card strong{
  color:var(--primary-3);
  font-size:24px;
  line-height:1;
}

.selected-users-panel{
  border:1px solid var(--line);
  background:linear-gradient(180deg, #fff 0%, var(--primary-soft-2) 100%);
  border-radius:20px;
  padding:14px;
  display:grid;
  gap:12px;
}

.selected-users-panel-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.selected-users-panel-head strong{
  display:block;
  color:var(--text);
}

.selected-users-panel-head small,
.selected-users-empty{
  color:var(--muted);
  font-size:13px;
}

.selected-users-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height:34px;
  align-items:center;
}

.selected-user-chip{
  border:1px solid rgba(109,119,103,.24);
  background:#fff;
  border-radius:999px;
  min-height:35px;
  padding:6px 6px 6px 6px;
  display:inline-grid;
  grid-template-columns:1fr auto;
  column-gap:8px;
  align-items:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(32,38,32,.05);
}

.selected-user-chip span,
.selected-user-chip small{
  grid-column:1;
  text-align:left;
  max-width:230px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.selected-user-chip span{
  color:var(--text);
  font-weight:600;
  font-size:13px;
}

.selected-user-chip small{
  color:var(--muted);
  font-size:11px;
}

.selected-user-chip b{
  grid-column:2;
  grid-row:1 / span 2;
  width:16px;
  height:16px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background-color: #c8e4ce62;
  color:var(--primary-3);
  line-height:1;
}

.reto-add-users-table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}

.add-users-table{
  min-width:820px;
}

.add-users-table .selectable-add-user-row{
  cursor:pointer;
}

.add-users-table .selectable-add-user-row:hover td{
  background:var(--primary-soft-2);
}

.add-user-row.is-hidden-by-filter{
  display:none !important;
}

.add-users-actions-row{
  align-items:center;
}

@media (max-width: 980px){
  .add-users-live-toolbar{
    grid-template-columns:1fr;
  }

  .add-users-counter-card{
    width:100%;
  }

  .reto-add-users-table-wrap{
    padding-bottom:8px;
  }

  .reto-add-users-table-wrap::after{
    content:"Desliza a la derecha para ver más";
    display:block;
    width:max-content;
    margin-top:6px;
    color:var(--muted);
    font-size:12px;
  }

  .add-users-table{
    width:820px !important;
    min-width:820px !important;
  }

  .add-users-table th,
  .add-users-table td{
    white-space:nowrap;
  }

  .add-users-table .table-user strong,
  .add-users-table .table-user p{
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .selected-users-panel{
    padding:12px;
    border-radius:18px;
  }

  .selected-users-list{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px;
  }

  .selected-user-chip{
    min-width:max-content;
  }

  .add-users-table{
    width:760px !important;
    min-width:760px !important;
  }
}
/* =========================================================
   Seguimiento nutricional - fecha de control responsive
   ========================================================= */

.seguimiento-date-toolbar{
  width:100%;
  display:block;
}

.seguimiento-date-field{
  width:100%;
  min-width:0;
}

.seguimiento-date-controls{
  display:grid;
  grid-template-columns:minmax(180px, 260px) auto auto;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:100%;
  min-width:0;
}

.seguimiento-date-controls input[type="date"]{
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  -webkit-appearance:none;
  appearance:none;
}

.required-star{
  color:#dc2626;
  font-weight:900;
  margin-left:3px;
}

@media (max-width:640px){
  .seguimiento-date-controls{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }

  .seguimiento-date-controls .btn,
  .seguimiento-date-controls .status-pill{
    width:100%;
  }

  .seguimiento-date-controls .status-pill{
    justify-content:center;
  }
}

/* =========================================================
   Seguimiento nutricional - controles compactos v2
   ========================================================= */

.seguimiento-date-controls{
  grid-template-columns:minmax(0, 240px) auto !important;
  align-items:end !important;
}

.seguimiento-load-date-btn{
  min-height:38px !important;
  padding:0 12px !important;
  border-radius:12px !important;
  font-size:13px !important;
  width:auto !important;
  align-self:end !important;
  white-space:nowrap;
}

.seguimiento-control-header{
  align-items:center !important;
  gap:12px !important;
  margin-bottom:14px !important;
}

.seguimiento-control-title{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  min-width:0;
}

.seguimiento-control-title h2{
  margin:0 !important;
}

.bulk-check-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:34px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--primary-soft-2);
  color:var(--primary-3);
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
  transition:.16s ease;
}

.bulk-check-pill:hover{
  border-color:rgba(109,119,103,.35);
  box-shadow:0 10px 22px rgba(32,38,32,.06);
}

.bulk-check-pill input{
  width:16px;
  height:16px;
  min-height:16px;
  accent-color:var(--primary);
  margin:0;
}

.bulk-check-pill:has(input:checked){
  background:#dcfce7;
  border-color:#bbf7d0;
  color:#166534;
}

@media (max-width:640px){
  .seguimiento-date-controls{
    grid-template-columns:minmax(0, 1fr) auto !important;
    gap:8px !important;
  }

  .seguimiento-load-date-btn{
    min-height:38px !important;
    padding:0 10px !important;
    font-size:12px !important;
    width:auto !important;
  }

  .seguimiento-control-header{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:space-between !important;
  }

  .seguimiento-control-title{
    gap:7px;
  }

  .seguimiento-control-title h2{
    font-size:18px !important;
  }

  .seguimiento-control-title .status-pill{
    min-height:28px;
    padding:0 9px;
    font-size:12px;
  }

  .bulk-check-pill{
    min-height:32px;
    padding:0 10px;
    font-size:12px;
  }
}


/* =========================================================
   Formulario alumno - campos obligatorios y fecha responsive
   ========================================================= */
.form-required-banner{
  margin-bottom:18px;
}

.required-star{
  color:#dc2626;
  font-weight:900;
  margin-left:3px;
}

.form-section,
.form-grid,
.form-field{
  min-width:0;
}

.form-field input,
.form-field select,
.form-field textarea{
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}

.form-field input[type="date"]{
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  -webkit-appearance:none;
  appearance:none;
}
