/* =========================================================
   NutriPro — Hoja de estilos principal
   Fuentes: Outfit (títulos) · DM Sans (cuerpo)
   ========================================================= */

:root {
  --green-50:  #E1F5EE;
  --green-100: #9FE1CB;
  --green-400: #1D9E75;
  --green-600: #0F6E56;
  --green-800: #085041;
  --green-900: #04342C;

  --gray-50:  #F8F9FA;
  --gray-100: #F1F3F4;
  --gray-200: #E8EAED;
  --gray-300: #DADCE0;
  --gray-400: #BDC1C6;
  --gray-500: #80868B;
  --gray-600: #5F6368;
  --gray-700: #3C4043;
  --gray-800: #202124;
  --gray-900: #17181C;

  --blue-50:  #E8F0FE;
  --blue-400: #4285F4;
  --blue-600: #1A73E8;

  --amber-50:  #FEF7E0;
  --amber-400: #FBBC04;
  --amber-600: #F9AB00;

  --red-50:  #FCE8E6;
  --red-400: #EA4335;
  --red-600: #D93025;

  --sidebar-bg:    #0F2A22;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active:#1D9E75;
  --sidebar-text:  rgba(255,255,255,0.65);
  --sidebar-width: 240px;

  --card-radius: 12px;
  --border:      1px solid var(--gray-200);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);

  --font-head: 'Outfit', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-400); text-decoration: none; }
a:hover { color: var(--green-600); }

/* =========================================================
   LAYOUT
   ========================================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--green-400);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: white;
  letter-spacing: -.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.3);
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 400;
  transition: all .15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--green-400);
  color: white;
  font-weight: 500;
}

.nav-item svg { flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--green-400);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }

.user-name {
  font-size: 13px; font-weight: 500; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

.logout-btn {
  color: rgba(255,255,255,0.35);
  display: flex; align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}

.logout-btn:hover { color: white; }

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: white;
  border-bottom: var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-600);
  padding: 4px;
  border-radius: 6px;
}

.menu-toggle:hover { background: var(--gray-100); }

.topbar-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-800);
  flex: 1;
}

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

.page-body { padding: 28px; flex: 1; }

/* =========================================================
   BOTONES
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
  font-family: var(--font-body);
  text-decoration: none;
  line-height: 1;
}

.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--green-400);
  color: white;
  border-color: var(--green-400);
}
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); color: white; }

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-100); }

.btn-danger {
  background: var(--red-50);
  color: var(--red-600);
  border-color: var(--red-400);
}
.btn-danger:hover { background: var(--red-400); color: white; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   TARJETAS
   ========================================================= */
.card {
  background: white;
  border-radius: var(--card-radius);
  border: var(--border);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-800);
}

.card-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* =========================================================
   MÉTRICAS
   ========================================================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: white;
  border: var(--border);
  border-radius: var(--card-radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green-400);
}

.metric-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--green-50);
  display: flex; align-items: center; justify-content: center;
  color: var(--green-600);
  margin-bottom: 14px;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1;
}

.metric-change {
  font-size: 12px;
  color: var(--green-400);
  margin-top: 6px;
  font-weight: 500;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */
.form-section {
  background: white;
  border: var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  margin-bottom: 20px;
}

.form-section-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--green-600);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-50);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-label .required { color: var(--red-400); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--gray-800);
  background: white;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.12);
}

.form-control::placeholder { color: var(--gray-400); }

textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6368' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.form-hint { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; }
.form-error { font-size: 11.5px; color: var(--red-600); margin-top: 3px; }

.form-control.is-invalid { border-color: var(--red-400); }

/* =========================================================
   TABLAS
   ========================================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--card-radius);
  border: var(--border);
  background: white;
}

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

table thead tr {
  border-bottom: var(--border);
  background: var(--gray-50);
}

table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  white-space: nowrap;
}

table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13.5px;
  color: var(--gray-700);
}

table tbody tr:last-child td { border-bottom: none; }

table tbody tr:hover { background: var(--gray-50); }

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}

.badge-green  { background: var(--green-50);  color: var(--green-600); }
.badge-blue   { background: var(--blue-50);   color: var(--blue-600); }
.badge-amber  { background: var(--amber-50);  color: #B45309; }
.badge-red    { background: var(--red-50);    color: var(--red-600); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-600); }

/* =========================================================
   AVATAR
   ========================================================= */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}

.avatar-green { background: var(--green-50);  color: var(--green-600); }
.avatar-blue  { background: var(--blue-50);   color: var(--blue-600); }
.avatar-amber { background: var(--amber-50);  color: #B45309; }
.avatar-red   { background: var(--red-50);    color: var(--red-600); }

/* =========================================================
   CARDS DE DIETA / IA
   ========================================================= */
.diet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.diet-card {
  background: white;
  border: var(--border);
  border-radius: var(--card-radius);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.diet-card:hover {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.1);
  transform: translateY(-2px);
}

.diet-card.selected {
  border: 2px solid var(--green-400);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.12);
}

.diet-card .recommended-badge {
  position: absolute;
  top: -1px; right: 16px;
  background: var(--green-400);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
}

.diet-name {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-800);
  margin: 12px 0 4px;
}

.diet-kcal {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
  color: var(--green-600);
  line-height: 1;
}

.diet-kcal small { font-size: 13px; font-weight: 400; color: var(--gray-500); }

.macro-bars { margin: 14px 0; }

.macro-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.bar-track {
  height: 5px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bar-fill { height: 100%; border-radius: 3px; }
.bar-prot { background: var(--green-400); }
.bar-carb { background: var(--blue-400); }
.bar-fat  { background: var(--amber-600); }

.diet-desc {
  font-size: 12.5px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 10px;
  border-top: var(--border);
}

/* =========================================================
   PANEL DE IA
   ========================================================= */
.ai-panel {
  background: linear-gradient(135deg, #E1F5EE 0%, #F0FAF6 100%);
  border: 1px solid var(--green-100);
  border-radius: var(--card-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.ai-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-600);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}

.ai-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.2); }
}

.ai-text { font-size: 13.5px; color: var(--green-800); line-height: 1.7; }

/* =========================================================
   TIMELINE (expediente)
   ========================================================= */
.timeline { padding: 0; }

.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot-col { display: flex; flex-direction: column; align-items: center; }

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green-400);
  flex-shrink: 0;
  margin-top: 4px;
  border: 2px solid var(--green-100);
}

.timeline-line {
  width: 1px;
  flex: 1;
  background: var(--gray-200);
  margin: 4px 0;
}

.timeline-date { font-size: 11.5px; color: var(--gray-500); margin-bottom: 3px; }
.timeline-title { font-size: 13.5px; font-weight: 500; color: var(--gray-800); }
.timeline-body { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; line-height: 1.5; }

/* =========================================================
   BUSCADOR
   ========================================================= */
.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.search-bar input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: var(--font-body);
  background: white;
  color: var(--gray-800);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.12);
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--gray-800);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp .25s ease;
  max-width: 340px;
}

.toast.toast-success { background: var(--green-600); }
.toast.toast-error   { background: var(--red-600); }
.toast.toast-info    { background: var(--blue-600); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   LOADER / SPINNER
   ========================================================= */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}

.loading-overlay.show { display: flex; }

.loading-card {
  background: white;
  border-radius: 16px;
  border: var(--border);
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.loading-card .big-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--green-50);
  border-top-color: var(--green-400);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}

.loading-card p {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
}

.loading-card small {
  font-size: 12.5px;
  color: var(--gray-400);
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
}

.login-brand {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  text-align: center;
}

.login-brand-logo {
  width: 64px; height: 64px;
  background: var(--green-400);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  color: white;
}

.login-brand h1 {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}

.login-brand p {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  max-width: 280px;
  line-height: 1.7;
}

.login-features {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 280px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.login-feature-icon {
  width: 32px; height: 32px;
  background: rgba(29,158,117,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-400);
  flex-shrink: 0;
}

.login-feature-text { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.4; }

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--gray-50);
}

.login-form-box {
  width: 100%;
  max-width: 380px;
}

.login-form-box h2 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.login-form-box .login-sub {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 32px;
}

/* =========================================================
   PATIENT PROFILE HEADER
   ========================================================= */
.patient-profile {
  background: white;
  border: var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.patient-avatar-lg {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--green-50);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--green-600);
  flex-shrink: 0;
}

.patient-profile-info { flex: 1; }
.patient-profile-name {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.patient-profile-meta { font-size: 13px; color: var(--gray-500); }
.patient-profile-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.patient-stat-row {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.patient-stat {
  background: white;
  border: var(--border);
  border-radius: var(--card-radius);
  padding: 16px 18px;
}

.patient-stat label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; }
.patient-stat span  { display: block; font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--gray-800); margin-top: 4px; }

/* =========================================================
   ALERTA / AVISO DE CONFIGURACIÓN
   ========================================================= */
.config-alert {
  background: var(--amber-50);
  border: 1px solid var(--amber-400);
  border-radius: var(--card-radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.config-alert svg { color: var(--amber-600); flex-shrink: 0; margin-top: 1px; }

.config-alert-text { font-size: 13.5px; color: #92400E; line-height: 1.6; }
.config-alert-text strong { font-weight: 600; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .diet-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .form-row-3, .form-row-4 { grid-template-columns: 1fr 1fr; }
  .patient-stat-row { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 600px) {
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
}
