/* ============================================================
   KFIT Health App – Design System
   ============================================================ */

:root {
  --primary:       #00C896;
  --primary-dark:  #00A87E;
  --primary-light: #E6FAF5;
  --secondary:     #1A2236;
  --bg:            #F0F4F8;
  --card:          #FFFFFF;
  --text:          #1A2236;
  --text-muted:    #6B7280;
  --border:        #E8EDF2;

  /* Macro colors */
  --cal:   #FF6B6B;
  --carb:  #4A90D9;
  --fat:   #F5A623;
  --prot:  #8E44AD;
  --fiber: #27AE60;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow:    0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --nav-h: 70px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
body.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.app-page { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* ── APP BAR ─────────────────────────────────────────────── */
.app-bar {
  background: var(--card);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
}
.app-bar-title { font-size: 18px; font-weight: 700; }
.app-bar-logo  { height: 30px; width: auto; }
.app-bar-action {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 19px; cursor: pointer; border: none;
}

/* ── BOTTOM NAV ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 200;
  overflow: visible;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

/* Cada tab regular: ocupa 1/5 del ancho, columna centrada */
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 2px;
  color: var(--text-muted); transition: color 0.2s;
  min-width: 0;
}
.nav-item.active { color: var(--primary-dark); }
.nav-item svg    { width: 22px; height: 22px; flex-shrink: 0; }
.nav-item span   { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; }

/* Slot central: mismo ancho que los otros tabs, contiene el círculo */
.nav-scan-slot {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
}

/* Círculo del botón de escanear */
.nav-scan {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px;          /* sobresale por encima del borde del nav */
  position: relative; z-index: 10;
  box-shadow: 0 4px 20px rgba(0,200,150,.55);
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-scan:active { transform: scale(0.94); }
.nav-scan svg    { width: 26px; height: 26px; }

/* ── HERO CARD (DASHBOARD) ──────────────────────────────── */
.hero-card {
  margin: 16px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius-xl);
  padding: 26px 22px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,168,126,.35);
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.hero-greeting { font-size: 13px; opacity: .85; }
.hero-name     { font-size: 20px; font-weight: 800; }
.hero-date     { font-size: 11px; opacity: .7; margin-top: 2px; }
.hero-badge    {
  background: rgba(255,255,255,.2); border-radius: var(--radius-sm);
  padding: 4px 10px; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px);
}

.calorie-section { display: flex; align-items: center; gap: 22px; }
.calorie-ring-wrap { position: relative; flex-shrink: 0; }
.calorie-ring { transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 8; }
.ring-fill { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.ring-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); text-align: center;
}
.ring-cal-num   { font-size: 22px; font-weight: 900; line-height: 1; }
.ring-cal-label { font-size: 10px; opacity: .75; font-weight: 600; letter-spacing: .5px; }

.calorie-info { flex: 1; }
.cal-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-row:last-child { margin-bottom: 0; }
.cal-label { font-size: 13px; opacity: .85; }
.cal-value { font-size: 13px; font-weight: 700; }

/* ── MACRO GRID ─────────────────────────────────────────── */
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 16px 16px; }
.macro-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.macro-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.macro-name  { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.macro-icon  { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.macro-value { font-size: 22px; font-weight: 800; line-height: 1; margin-bottom: 2px; }
.macro-unit  { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.macro-bar-bg   { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.macro-bar-fill { height: 100%; border-radius: 99px; transition: width .8s ease; }

.macro-carb .macro-icon { background:#EBF4FF; color:var(--carb); }
.macro-carb .macro-value { color: var(--carb); }
.macro-carb .macro-bar-fill { background: var(--carb); }

.macro-fat  .macro-icon { background:#FFF8E6; color:var(--fat); }
.macro-fat  .macro-value { color: var(--fat); }
.macro-fat  .macro-bar-fill { background: var(--fat); }

.macro-prot .macro-icon { background:#F5EEFB; color:var(--prot); }
.macro-prot .macro-value { color: var(--prot); }
.macro-prot .macro-bar-fill { background: var(--prot); }

.macro-fiber .macro-icon { background:#E8F5E9; color:var(--fiber); }
.macro-fiber .macro-value { color: var(--fiber); }
.macro-fiber .macro-bar-fill { background: var(--fiber); }

/* ── MEAL CHIPS ─────────────────────────────────────────── */
.macro-chip  { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.chip-cal    { background:#FFF0F0; color:var(--cal); }
.chip-carb   { background:#EBF4FF; color:var(--carb); }
.chip-fat    { background:#FFF8E6; color:var(--fat); }
.chip-prot   { background:#F5EEFB; color:var(--prot); }

/* ── SECTION HEADER ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 10px;
}
.section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; }
.section-link  { font-size: 12px; font-weight: 600; color: var(--primary-dark); }

/* ── RECENT MEAL LIST ───────────────────────────────────── */
.meal-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.meal-item {
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm);
}
.meal-img             { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.meal-img-placeholder { width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.meal-info     { flex: 1; min-width: 0; }
.meal-name     { font-size: 14px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-macros   { display: flex; gap: 6px; flex-wrap: wrap; }
.meal-cal-big  { font-size: 18px; font-weight: 800; color: var(--cal); flex-shrink: 0; }

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-hero {
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, #7EDCBE 100%);
  padding: 60px 32px 80px;
  text-align: center; color: #fff;
}
.login-hero-icon {
  width: 86px; height: 86px;
  background: rgba(255,255,255,.22); border-radius: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px; backdrop-filter: blur(10px);
}
.login-hero-icon img   { width: 58px; height: 58px; object-fit: contain; }
.login-hero-title      { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.login-hero-sub        { font-size: 14px; opacity: .8; margin-top: 6px; }
.login-card {
  background: var(--card);
  margin: -32px 18px 0;
  border-radius: var(--radius-xl);
  padding: 32px 22px 28px;
  box-shadow: var(--shadow-lg);
}
.login-card-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-card-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 26px; }
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 7px; }
.form-control {
  display: block; width: 100%; padding: 13px 15px;
  font-size: 15px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  outline: none; transition: border-color .2s; font-family: inherit;
}
.form-control:focus { border-color: var(--primary); background: #fff; }
.forgot-link { display: block; text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }
.forgot-link a { color: var(--primary-dark); font-weight: 600; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: block; width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  text-align: center; box-shadow: 0 4px 16px rgba(0,168,126,.35);
  transition: opacity .2s, transform .1s; font-family: inherit; letter-spacing: .3px;
}
.btn-primary:hover  { opacity: .95; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 18px; background: var(--bg);
  color: var(--text); font-size: 14px; font-weight: 600;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; transition: background .2s;
}
.btn-secondary:hover { background: var(--border); }

/* ── UPLOAD / SCAN ──────────────────────────────────────── */
.upload-zone {
  margin: 16px; border: 2.5px dashed var(--primary);
  border-radius: var(--radius-lg); padding: 40px 24px;
  text-align: center; background: var(--primary-light);
  cursor: pointer; transition: background .2s, border-color .2s;
}
.upload-zone:hover, .upload-zone.dragover { background: #C8F5E8; border-color: var(--primary-dark); }
.upload-zone-icon  { font-size: 52px; margin-bottom: 12px; }
.upload-zone-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.upload-zone-sub   { font-size: 13px; color: var(--text-muted); }

.upload-preview { margin: 0 16px 16px; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); }
.upload-preview img { width: 100%; max-height: 280px; object-fit: cover; display: block; }
.upload-preview-bar { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; }
.upload-preview-name { font-size: 13px; color: var(--text-muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-scan {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 16px 16px; padding: 17px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--radius); cursor: pointer;
  width: calc(100% - 32px);
  box-shadow: 0 4px 16px rgba(0,168,126,.4);
  font-family: inherit; transition: opacity .2s;
}
.btn-scan:disabled { opacity: .6; cursor: not-allowed; }

.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESULTS ─────────────────────────────────────────────── */
.result-banner { margin: 0 16px 14px; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
.result-banner.success { background: #E6FAF5; color: #00875A; border-left: 4px solid var(--primary); }
.result-banner.error   { background: #FFF0F0; color: #C0392B; border-left: 4px solid var(--cal); }
.result-food-name { margin: 0 16px 14px; font-size: 20px; font-weight: 800; }
.result-calories-big { margin: 0 16px 14px; background: linear-gradient(135deg,#FF6B6B,#FF8E53); border-radius: var(--radius); padding: 20px; text-align: center; color: #fff; }
.rcal-num   { font-size: 52px; font-weight: 900; line-height: 1; }
.rcal-label { font-size: 14px; opacity: .85; font-weight: 600; margin-top: 4px; }

.result-macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 12px; }
.result-macro-item { background: var(--card); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); text-align: center; }
.rmi-value { font-size: 20px; font-weight: 800; }
.rmi-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.rmi-carb  .rmi-value { color: var(--carb); }
.rmi-fat   .rmi-value { color: var(--fat); }
.rmi-prot  .rmi-value { color: var(--prot); }
.rmi-fiber .rmi-value { color: var(--fiber); }

.result-other-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 0 16px 24px; }
.rother-item { background: var(--card); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm); text-align: center; }
.rother-value { font-size: 16px; font-weight: 800; }
.rother-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* ── HISTORY ─────────────────────────────────────────────── */
.date-badge {
  margin: 16px 16px 8px; font-size: 12px; font-weight: 700; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.date-badge::after { content:''; flex:1; height:1px; background:var(--border); }

.history-item {
  margin: 0 16px 10px; background: var(--card); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow-sm);
  position: relative;
}
.hi-image       { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.hi-placeholder { width: 64px; height: 64px; border-radius: var(--radius-sm); background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.hi-body   { flex: 1; min-width: 0; }
.hi-name   { font-size: 14px; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-chips  { display: flex; flex-wrap: wrap; gap: 5px; }
.hi-cal-badge { font-size: 16px; font-weight: 800; color: var(--cal); white-space: nowrap; }
.hi-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 4px 2px;
  border-radius: 6px; transition: color .2s, background .2s;
  flex-shrink: 0; align-self: flex-start;
}
.hi-delete:hover { color: #E53935; background: #FFEBEE; }

/* Modal confirmación eliminar */
.del-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 999;
  align-items: flex-end; justify-content: center;
}
.del-modal-overlay.open { display: flex; }
.del-modal {
  background: var(--card); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 24px 36px; width: 100%; max-width: 480px;
  animation: slideUp .25s ease;
}
.del-modal-icon { font-size: 40px; text-align: center; margin-bottom: 10px; }
.del-modal-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.del-modal-sub   { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.del-modal-name  { font-weight: 700; color: var(--text); }
.del-modal-btns  { display: flex; gap: 12px; }
.del-btn-cancel  {
  flex: 1; padding: 14px; border-radius: var(--radius); border: 2px solid var(--border);
  background: none; font-size: 15px; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.del-btn-confirm {
  flex: 1; padding: 14px; border-radius: var(--radius); border: none;
  background: #E53935; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── HISTORY TOGGLE ──────────────────────────────────────── */
.history-toggle {
  margin: 4px 16px 16px;
  display: flex;
  background: var(--card);
  border-radius: 50px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  gap: 0;
}
.ht-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 12px; border-radius: 50px; border: none;
  background: none; cursor: pointer; font-size: 13px; font-weight: 700;
  color: var(--text-muted); transition: background .2s, color .2s;
  white-space: nowrap; overflow: hidden;
}
.ht-btn.ht-active { background: #fff; color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,.1); }
.ht-btn.ht-active-amo { background: #FFF3E0; color: #E65100; box-shadow: 0 1px 6px rgba(230,81,0,.15); }
.ht-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.ht-avatar-self { background: linear-gradient(135deg,var(--primary-dark),var(--primary)); }
.ht-avatar-amo  { background: linear-gradient(135deg,#E65100,#FF9800); }
.ht-section { transition: opacity .2s; }
.ht-section.hidden { display: none; }

/* ── DETAIL MODAL ────────────────────────────────────────── */
.detail-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 1000;
  align-items: flex-end; justify-content: center;
}
.detail-overlay.open { display: flex; }
.detail-sheet {
  background: var(--bg); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 480px; max-height: 92vh;
  overflow-y: auto; animation: slideUp .28s ease;
  padding-bottom: 32px;
}
.detail-hero {
  width: 100%; max-height: 320px; object-fit: contain;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block; background: #111;
}
.detail-hero-placeholder {
  width: 100%; height: 200px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
}
.detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 0;
}
.detail-food-name { font-size: 19px; font-weight: 800; flex: 1; line-height: 1.3; }
.detail-close {
  background: var(--border); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: 12px; color: var(--text-muted);
}
.detail-cal-block {
  text-align: center; padding: 16px 20px 8px;
}
.detail-cal-num  { font-size: 52px; font-weight: 900; color: var(--cal); line-height: 1; }
.detail-cal-lbl  { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.detail-macro-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; margin: 12px 16px 0;
}
.detail-macro-item {
  background: var(--card); border-radius: var(--radius); padding: 14px 10px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.detail-macro-val { font-size: 20px; font-weight: 800; }
.detail-macro-lbl { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.dmi-carb .detail-macro-val { color: var(--carb); }
.dmi-fat  .detail-macro-val { color: var(--fat); }
.dmi-prot .detail-macro-val { color: var(--prot); }
.detail-others {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px; margin: 10px 16px 0;
}
.detail-other-item {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 10px 6px; text-align: center; box-shadow: var(--shadow-sm);
}
.detail-other-val { font-size: 14px; font-weight: 800; color: var(--text); }
.detail-other-lbl { font-size: 9px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }
.detail-date-row  { padding: 12px 20px 0; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.detail-owner-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; margin-left: 8px;
}
.badge-self { background: var(--primary-light); color: var(--primary-dark); }
.badge-amo  { background: #FFF3E0; color: #E65100; }

/* Historia amo separador */
.section-owner-header {
  margin: 20px 16px 8px;
  display: flex; align-items: center; gap: 10px;
}
.soh-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.soh-avatar-self { background: linear-gradient(135deg,var(--primary-dark),var(--primary)); }
.soh-avatar-amo  { background: linear-gradient(135deg,#E65100,#FF9800); }
.soh-title { font-size: 14px; font-weight: 800; color: var(--text); }
.soh-sub   { font-size: 11px; color: var(--text-muted); }

/* ── PROFILE ─────────────────────────────────────────────── */
.profile-hero { background: linear-gradient(135deg,var(--primary-dark) 0%,var(--primary) 100%); padding: 40px 24px 60px; text-align: center; color: #fff; }
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; font-size: 38px; margin-bottom: 14px; border: 3px solid rgba(255,255,255,.5); }
.profile-name  { font-size: 22px; font-weight: 800; }
.profile-email { font-size: 13px; opacity: .75; margin-top: 4px; }
.profile-stats { margin: -28px 16px 0; background: var(--card); border-radius: var(--radius-lg); padding: 20px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; box-shadow: var(--shadow); text-align: center; position: relative; z-index: 10; }
.pstat-value { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.pstat-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.profile-list { margin: 16px; display: flex; flex-direction: column; gap: 2px; }
.profile-row  { background: var(--card); padding: 15px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.profile-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.profile-row:last-child  { border-radius: 0 0 var(--radius) var(--radius); }
.profile-row:only-child  { border-radius: var(--radius); }
.pr-icon  { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.pr-text  { flex: 1; }
.pr-title { font-size: 14px; font-weight: 600; }
.pr-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.pr-arrow { color: var(--text-muted); font-size: 16px; }
.pr-danger .pr-title { color: #E74C3C; }
.pr-danger .pr-icon  { background: #FFF0F0; }

/* ── REPORTS ─────────────────────────────────────────────── */
.input-group-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 12px; }
.input-group-label { padding: 12px 16px 4px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.input-group-card input[type=date] { display: block; width: 100%; padding: 8px 16px 14px; font-size: 15px; border: none; outline: none; background: transparent; color: var(--text); font-family: inherit; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state { padding: 60px 32px; text-align: center; }
.empty-icon  { font-size: 58px; margin-bottom: 14px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 22px; }

/* ── UTILS ───────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.text-muted { color: var(--text-muted); }
