/* [FILE:stylesheets.css] */

/* [BASE/RESET] */
/* ====================================================== */
/* styles.css — estructura responsive con header y footer */
/* ====================================================== */
:root{
  --app-w: 390px;            /* ancho objetivo del teléfono */
  --h: 250px;                /* alto del header (index) */
  --f: 50px;                 /* alto del footer */
  --subheader-top: 250px;    /* posición Y del subheader (index) */
  --subheader-h: 68px;       /* alto del subheader (index) */
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
/* [/BASE/RESET] */

/* [BASE/LAYOUT] */
/* Contenedor “teléfono” */
.phone{
  position: relative;
  width: 100%;
  height: 100vh;
  max-width: var(--app-w);
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}

/* Header fijo (patrón centrado) */
header{
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  height: calc(var(--h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: grid;
  place-items: center;
  z-index: 10;
  background: #8D8ED3;  /* header de INDEX por defecto */
}

/* Footer fijo (patrón centrado) */
footer{
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  height: calc(var(--f) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  place-items: center;
  z-index: 10;
  background: #8BE9E9;
}

/* Área central (main) */
main{
  position: relative;
  height: 100vh;
  max-width: var(--app-w);
  margin: 0 auto;
  overflow-y: auto;

  /* Evitar solapamiento con header/subheader/footer */
  padding-top: calc(var(--subheader-top) + var(--subheader-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--f) + env(safe-area-inset-bottom));
  background: #BFFEEC;
}

/* Centrado en pantallas grandes (opcional) */
@media (min-width: 420px){
  body{
    display: grid;
    place-items: start center;
    background: #0f172a;
  }
}
/* [/BASE/LAYOUT] */

/* [PAGE/INDEX] */
/* Contenedor interno */
.header-content{
  position: relative;
  height: var(--h);
  width: 100%;
}

/* IMAGEN (avatar) */
.header-content .imagen{
  position: absolute;
  left: 33px;
  top: 20px;
  width: 80px;
  height: 80px;
}
.header-content .imagen img{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 2px solid #ffffff66;
}

/* SALUDO */
.header-content .saludo{
  position: absolute;
  left: 144px;
  top: 20px;
  width: 177px;
  height: 64px;
  color: #ffffff;
}
.header-content .saludo h1{
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 65px;
  line-height: 64px;
  font-weight: 800;
}

/* MENSAJE (recuadro) */
.header-content .mensaje{
  position: absolute;
  left: 26px;
  top: 123px;
  width: 315px;
  height: 88px;
  background: #D2FFFA;
  border-radius: 25px;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
}
.header-content .mensaje p{
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  font-size: 18px;
  color: #64DFDF;
}
/* [/PAGE/INDEX] */

/* [INDEX/SUBHEADER] */
.subheader {
  position: fixed;
  top: var(--subheader-top);
  left: 50%;
  transform: translateX(-50%);
  width: var(--app-w);
  height: var(--subheader-h);
  background: #8BE9E9;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-btn {
  position: absolute;
  left: 36px;
  top: 21px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11;
}
.calendar-btn svg {
  width: 24px !important;
  height: 24px !important;
  color: #ffffff;
  stroke-width: 1.2;
}
.subheader-content{
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
}
.subheader-content .metric:first-child {
  margin-left: 40px;
}
.metric{
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.metric .label{
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #8D8ED3;
}
.metric .value{
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: #ffffff;
}
/* [/INDEX/SUBHEADER] */

/* [INDEX/FORM] */
.form{
  display: grid;
  gap: 12px;
  padding: 16px;
}
.field{ position: relative; }
.field input,
.field select{
  width: 100%;
  height: 44px;
  padding-left: 44px;
  border-radius: 10px;
  border: 1px solid #8D8ED3;
  background: #EFFBFA;
  color: #8F8F8F;
}
.field svg{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: #8D8ED3;
  stroke-width: 1.2;
  pointer-events: none;
}
.visually-hidden{
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.save-btn{
  width: 122px;
  height: 34px;
  background: #8D8ED3;
  color: #ffffff;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  display: block;
  margin: 16px auto 24px;
  transition: transform .15s ease, opacity .15s ease;
}
.save-btn:hover { opacity: 0.9; }
.save-btn:active { transform: scale(0.96); }
/* [/INDEX/FORM] */

/* [COMPONENT/FOOTER] */
.footer-nav{
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.nav-btn{
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.footer-nav svg{
  width: 28px;
  height: 28px;
  color: #ffffff;
  stroke-width: 1.2;
  transition: color 0.2s ease, transform 0.15s ease;
}
.nav-btn:hover svg{
  color: #8D8ED3;
}
.nav-btn.active svg{
  color: #8D8ED3;
  stroke-width: 2.6;
}
/* [/COMPONENT/FOOTER] */

/* [PAGE/LOGS+DASHBOARD/HEADER] */
.page-logs header, .page-dashboard header{
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-w);
  height: 155px;               /* 80 + 75 */
  background: #8D8ED3;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: 10;
}
.page-logs .filters, .page-dashboard .filters {
  height: 80px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  max-width: 390px;
}
.page-logs .category-title, .page-dashboard .category-title {
  width: 100%;
  height: 75px;
  background: #8BE9E9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.page-logs .category-text, .page-dashboard .category-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
}
.page-logs .category-title h2, .page-dashboard .category-title h2{
  margin: 0;
  font-family: "Roboto", sans-serif;
  font-weight: 600;
  font-size: 35px;
  color: #ffffff;
}
.page-logs .category-title p, .page-dashboard .category-title p {
  margin: 4px 0 0 0;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #ffffffcc;
}
.page-logs main, .page-dashboard main{
  padding-top: calc(155px + env(safe-area-inset-top));
}
/* [/PAGE/LOGS+DASHBOARD/HEADER] */

/* [PAGE/LOGS/LIST] */
.page-logs .logs-wrap{
  padding: 12px 14px 90px;
}
.page-logs .logs-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-logs .log-item{
  display: grid;
  grid-template-columns: 32px 1fr auto 36px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  background: #EFFBFA;
  border: 1px solid #8D8ED3;
  border-radius: 12px;
}
.page-logs .log-icon{
  width: 24px;
  height: 24px;
  color: #8D8ED3;
  stroke-width: 1.6;
}
.page-logs .log-item[data-category="fun"] .log-icon{ color: #8D8ED3; }
.page-logs .log-item[data-category="groceries"] .log-icon{ color: #64DFDF; }
.page-logs .log-info .log-name{
  margin: 0;
  font-size: 15px;
  color: #0B1220;
  font-weight: 600;
}
.page-logs .log-info .log-meta{
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  color: #8F8F8F;
}
.log-meta .subcat {
  color: #8D8ED3;
  font-weight: 500;
  font-size: 0.9em;
  letter-spacing: 0.3px;
}
.page-logs .log-amount{
  font-weight: 700;
  color: #0B1220;
  white-space: nowrap;
}
.page-logs .log-menu{
  all: unset;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 8px;
}
.page-logs .log-menu i,
.page-logs .log-menu svg{
  width: 20px;
  height: 20px;
  color: #8D8ED3;
  stroke-width: 1.6;
}
.page-logs .log-menu:active{ transform: scale(.96); }
.page-logs .log-item { position: relative; }
.page-logs .menu-popover[hidden] { display: none !important; }
.page-logs .menu-popover{
  position: absolute;
  right: 6px;
  top: 44px;
  min-width: 120px;
  background: #ffffff;
  color: #0B1220;
  border: 1px solid #8D8ED3;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  z-index: 20;
}
.page-logs .menu-item{
  all: unset;
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 14px;
}
.page-logs .menu-item:hover { background: #EFFBFA; }
.page-logs .menu-item.delete { color: #d11a2a; }
/* [/PAGE/LOGS/LIST] */

/* [PAGE/DASH/WIDGET-CIRCLES] */
.dashboard-wrap{
  padding: 12px 14px 90px;
}
.dash-circles{ margin-top: 8px; }
.circle-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.circle-item{
  display: grid;
  place-items: center;
  gap: 6px;
}
.circle {
  --percent: 0;
  --border-color: #8D8ED3;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}
.circle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--border-color) calc(var(--percent) * 1%), #EFFBFA 0);
  mask: radial-gradient(circle 36px, transparent 36px, black 37px);
  -webkit-mask: radial-gradient(circle 36px, transparent 36px, black 37px);
}
.circle::after {
  content: attr(data-amount);
  position: relative;
  font: 700 14px "Roboto", sans-serif;
  color: #0B1220;
  z-index: 2;
}
.circle-label {
  font: 500 12px "Roboto", sans-serif;
  color: #8F8F8F;
  text-align: center;
  margin-top: 4px;
  line-height: 1.1;
}
.circle-item[data-category="fun"] .circle { --border-color: #8D8ED3; }
.circle-item[data-category="groceries"] .circle { --border-color: #64DFDF; }
.circle::before { transition: background 1s ease; }
.circle-label, .circle-amount{
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 360px){
  .circle{ width: 80px; height: 80px; }
  .circle-amount{ font-size: 13px; }
  .circle-label{ font-size: 11px; }
}
/* [/PAGE/DASH/WIDGET-CIRCLES] */

/* [/FILE:stylesheets.css] */
