:root {
     --ac: #00d4aa;
     --ac2: #00b4d8;
     --ink: #17303a;
     --mut: #6b7c86;
     --ln: #e6ebef;
     --tx: #0a7466;
     --tint: #c9eeee;
     --tint-ln: #7fcfc9;
     --low: #ef4458;
     --high: #f59e0b;
     --sb: 260px;
}
* {
     box-sizing: border-box;
}
html,
body {
     height: 100%;
     margin: 0;
}
body {
     font-family: Inter, system-ui, sans-serif;
     font-size: 13px;
     color: var(--ink);
     display: flex;
     flex-direction: column;
     height: 100dvh;
     overflow: hidden;
     -webkit-font-smoothing: antialiased;
     background: linear-gradient(135deg, #e3eaf2 0%, #ebe9f1 55%, #f3e6ec 100%);
}
button {
     font: inherit;
     color: inherit;
     background: none;
     border: 0;
     cursor: pointer;
     padding: 0;
}
h2,
h3,
h4,
p {
     margin: 0;
}
.hidden {
     display: none !important;
}
:focus-visible {
     outline: 2px solid var(--ac2);
     outline-offset: 2px;
}
::-webkit-scrollbar {
     width: 8px;
}
::-webkit-scrollbar-thumb {
     background: #c5d0d8;
     border-radius: 9px;
}

/* shell */
.shell {
     flex: 1;
     min-height: 0;
     display: flex;
}
.top {
     display: none;
     align-items: center;
     justify-content: space-between;
     height: 56px;
     padding: 0 16px;
     flex-shrink: 0;
     background: #fff;
     border-bottom: 1px solid var(--ln);
}
.brand {
     display: flex;
     align-items: center;
     gap: 8px;
     font-weight: 700;
     color: var(--ink);
     text-decoration: none;
}
.logo {
     width: 30px;
     height: 30px;
     border-radius: 9px;
     display: grid;
     place-items: center;
     font-size: 11px;
     font-weight: 700;
     color: #fff;
     background: linear-gradient(135deg, var(--ac), var(--ac2));
}
.ibtn {
     width: 32px;
     height: 32px;
     border-radius: 9px;
     border: 1px solid var(--ln);
     background: #fff;
     display: grid;
     place-items: center;
     color: var(--tx);
     font-size: 15px;
     text-decoration: none;
}
.ibtn:hover {
     background: #f2f8f8;
}

/* sidebar */
#sb {
     width: var(--sb);
     flex-shrink: 0;
     display: flex;
     flex-direction: column;
     background: rgba(255, 255, 255, 0.88);
     border-right: 1px solid var(--ln);
}
.doc {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 16px 16px 12px;
}
.av {
     width: 36px;
     height: 36px;
     border-radius: 50%;
     display: grid;
     place-items: center;
     flex-shrink: 0;
     font-size: 12px;
     font-weight: 500;
     background: #e8f0f2;
     color: var(--ink);
}
.av.ac {
     background: linear-gradient(135deg, var(--ac), var(--ac2));
     color: #fff;
}
.av.sel {
     background: #b5e6e2;
     color: var(--tx);
}
.doc .av {
     width: 40px;
     height: 40px;
}
.doc b,
.pr b {
     display: block;
     font-weight: 600;
     font-size: 13.5px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
}
.doc small,
.pr small {
     display: block;
     color: var(--mut);
     font-size: 11.5px;
     margin-top: 1px;
}
.search {
     margin: 0 16px 14px;
     position: relative;
}
.search input {
     width: 100%;
     height: 38px;
     padding: 0 32px 0 12px;
     border-radius: 10px;
     border: 1px solid #cfe0e3;
     background: #eef6f6;
     font: inherit;
     color: var(--ink);
}
.search input::placeholder {
     color: #6f858c;
}
#sclear {
     position: absolute;
     right: 8px;
     top: 9px;
     width: 20px;
     height: 20px;
     color: var(--mut);
}
#scount {
     font-size: 11px;
     color: var(--mut);
     padding: 0 16px 8px;
     min-height: 0;
}
#plist {
     flex: 1;
     min-height: 0;
     overflow-y: auto;
     border-top: 1px solid var(--ln);
}
.pr {
     display: flex;
     align-items: center;
     gap: 10px;
     width: 100%;
     text-align: left;
     padding: 10px 14px;
     border-left: 3px solid transparent;
}
.pr > div:nth-child(2) {
     flex: 1;
     min-width: 0;
}
.pr:hover {
     background: #f1f6f8;
}
.pr.on {
     background: var(--tint);
     border-left-color: #0e8a8a;
}
.pr.pend b {
     color: #9aa8b0;
     font-weight: 500;
}
.pr.pend small {
     font-size: 11px;
}
.dot {
     width: 8px;
     height: 8px;
     border-radius: 50%;
     flex-shrink: 0;
}
.g {
     background: var(--ac);
}
.a {
     background: var(--high);
}
.n {
     background: #64748b;
}
.side-foot {
     padding: 14px;
     border-top: 1px solid var(--ln);
}
#binv {
     width: 100%;
     height: 38px;
     border-radius: 10px;
     border: 1px solid #bcd9db;
     background: #e6f3f3;
     font-size: 12.5px;
     font-weight: 500;
}
#binv:hover {
     background: #d8ecec;
}

/* main */
#main {
     flex: 1;
     min-width: 0;
     display: flex;
     flex-direction: column;
}
.head {
     flex-shrink: 0;
     background: rgba(255, 255, 255, 0.9);
     border-bottom: 1px solid var(--ln);
     padding: 0 24px;
}
.head-row {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 12px;
     padding: 10px 0;
     flex-wrap: wrap;
}
.who {
     display: flex;
     align-items: center;
     gap: 12px;
     min-width: 0;
}
.who .av {
     width: 40px;
     height: 40px;
     font-size: 13px;
}
.who h2 {
     font-size: 15px;
     font-weight: 600;
}
.who p {
     font-size: 11.5px;
     color: var(--mut);
}
.right {
     display: flex;
     align-items: center;
     gap: 12px;
     font-size: 12px;
     color: #44565f;
}
.pill {
     display: inline-flex;
     align-items: center;
     gap: 5px;
     padding: 4px 12px;
     border-radius: 99px;
     font-size: 11px;
     background: var(--tint);
     border: 1px solid var(--tint-ln);
     color: var(--tx);
}
.tabs {
     display: flex;
     gap: 24px;
     overflow-x: auto;
}
.tab {
     padding: 12px 0 11px;
     font-size: 13.5px;
     color: #44565f;
     border-bottom: 2px solid transparent;
     white-space: nowrap;
}
.tab:hover {
     color: var(--ink);
}
.tab.on {
     color: #0a6d73;
     font-weight: 600;
     border-color: #0a8a8f;
}
#scroll {
     flex: 1;
     min-height: 0;
     overflow-y: auto;
     padding: 24px;
     scrollbar-gutter: stable;
}
.panel {
     display: none;
     flex-direction: column;
     gap: 16px;
}
.panel.on {
     display: flex;
}
#t-perfil.on {
     display: grid;
     grid-template-columns: 1fr 2.3fr;
     gap: 24px;
     align-items: start;
}

.card {
     background: rgba(255, 255, 255, 0.93);
     border-radius: 18px;
     box-shadow: 0 2px 12px rgba(40, 60, 90, 0.07);
     padding: 20px;
}
.card h3,
.card h4 {
     font-size: 13.5px;
     font-weight: 500;
}
.sub {
     font-size: 11.5px;
     color: var(--mut);
     margin-top: 3px;
}
.lbl {
     font-size: 10.5px;
     letter-spacing: 0.08em;
     text-transform: uppercase;
     color: #5c6e78;
}

/* inicio */
.grid2 {
     display: grid;
     grid-template-columns: 1fr 1.38fr;
     gap: 20px;
}
.gauge {
     display: flex;
     flex-direction: column;
     align-items: center;
     padding: 24px 20px;
     gap: 18px;
}
.ring {
     position: relative;
     width: 180px;
     height: 180px;
}
.ring svg {
     width: 100%;
     height: 100%;
     transform: rotate(-90deg);
}
.ring > div {
     position: absolute;
     inset: 0;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
}
#bv {
     font-size: 34px;
     font-weight: 600;
     line-height: 1;
}
.chips {
     display: flex;
     flex-wrap: wrap;
     justify-content: center;
     gap: 8px;
}
.chip {
     background: #fff;
     border: 1px solid var(--ln);
     border-left: 3px solid;
     border-radius: 6px;
     padding: 6px 10px;
     font-size: 11.5px;
}
.c-lo {
     border-left-color: var(--low);
}
.c-hi {
     border-left-color: var(--high);
}
.c-ok {
     border-left-color: var(--ac);
}
.stats {
     display: flex;
     flex-direction: column;
     gap: 14px;
}
.stat {
     flex: 1;
     display: flex;
     flex-direction: column;
     justify-content: center;
     gap: 5px;
}
.big {
     font-size: 27px;
     font-weight: 600;
     line-height: 1.1;
}
.big small {
     font-size: 23px;
     font-weight: 600;
}
.chart-wrap {
     margin-top: 8px;
     overflow-x: auto;
}
canvas {
     width: 100%;
     height: 230px;
     display: block;
     min-width: 480px;
}

/* historial / stats */
.bar {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 12px;
     flex-wrap: wrap;
}
.bar h3 {
     font-size: 15px;
     font-weight: 500;
}
.tg {
     padding: 6px 14px;
     border-radius: 99px;
     border: 1px solid #d5dde3;
     background: #fff;
     font-size: 12px;
}
.tg.on {
     background: var(--tint);
     border-color: var(--tint-ln);
     color: var(--tx);
}
.day {
     font-size: 10.5px;
     letter-spacing: 0.08em;
     text-transform: uppercase;
     color: var(--mut);
     margin-bottom: 8px;
}
.entry {
     display: flex;
     align-items: center;
     gap: 18px;
     padding: 14px 18px;
     margin-bottom: 10px;
     flex-wrap: wrap;
}
.meal {
     width: 36px;
     height: 36px;
     border-radius: 50%;
     flex-shrink: 0;
}
.entry .nm {
     min-width: 130px;
}
.nm b {
     display: block;
     font-weight: 500;
     font-size: 13.5px;
}
.nm small {
     color: var(--mut);
     font-size: 11px;
}
.gl {
     min-width: 100px;
     font-size: 21px;
     font-weight: 500;
}
.gl small {
     font-size: 12px;
     font-weight: 400;
     color: var(--mut);
}
.det {
     font-size: 12px;
     color: #44565f;
     min-width: 150px;
}
.tag {
     padding: 4px 10px;
     border-radius: 99px;
     font-size: 11px;
     border: 1px solid;
}
.t-lo {
     background: #fdebee;
     border-color: #f3b4bd;
     color: #b3213a;
}
.t-hi {
     background: #fdf3de;
     border-color: #f0d08a;
     color: #8a5a00;
}
.mood {
     margin-left: auto;
     display: flex;
     align-items: center;
     gap: 10px;
     font-size: 16px;
}
.stgrid {
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 18px;
}
.donut {
     width: 140px;
     height: 140px;
     border-radius: 50%;
     position: relative;
     flex-shrink: 0;
     -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%);
     mask: radial-gradient(circle, transparent 52%, #000 53%);
}
.legend {
     display: flex;
     flex-direction: column;
     gap: 9px;
     font-size: 12.5px;
}
.legend i {
     display: inline-block;
     width: 8px;
     height: 8px;
     border-radius: 50%;
     margin-right: 8px;
}
#carbs {
     display: flex;
     align-items: flex-end;
     justify-content: space-around;
     gap: 12px;
     height: 150px;
     margin-top: 14px;
     border-bottom: 1px solid var(--ln);
}
#carbs div {
     flex: 1;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 4px;
     font-size: 11.5px;
}
#carbs i {
     display: block;
     width: 100%;
     max-width: 100px;
     border-radius: 6px 6px 0 0;
     background: linear-gradient(180deg, var(--ac), var(--ac2));
}
.cl {
     display: flex;
     justify-content: space-around;
     font-size: 11.5px;
     color: #44565f;
     margin-top: 6px;
}
#adots {
     display: flex;
     gap: 8px;
     margin-top: 16px;
}
#adots div {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 5px;
     font-size: 10.5px;
     color: var(--mut);
}
#adots i {
     width: 28px;
     height: 28px;
     border-radius: 50%;
     background: #eef4f5;
     border: 1px solid #dbe6e8;
}
#adots i.y {
     background: linear-gradient(135deg, var(--ac), var(--ac2));
     border: 0;
}
.emo {
     display: flex;
     align-items: center;
     gap: 12px;
     margin-top: 14px;
     font-size: 12.5px;
}
.emo .t {
     flex: 1;
     height: 5px;
     border-radius: 9px;
     background: #e8f0f2;
     overflow: hidden;
}
.emo .t i {
     display: block;
     height: 100%;
     border-radius: 9px;
}
.emo .v {
     width: 34px;
     text-align: right;
}

/* rows */
.rows {
     margin-top: 6px;
}
.row {
     display: flex;
     justify-content: space-between;
     align-items: center;
     gap: 16px;
     padding: 12px 0;
     border-bottom: 1px solid var(--ln);
}
.row:last-child {
     border-bottom: 0;
}
.row .v {
     font-size: 13px;
     font-weight: 500;
     display: inline-flex;
     align-items: center;
     gap: 8px;
     text-align: right;
}
.row small.n2 {
     display: block;
     font-size: 11px;
     color: var(--mut);
     font-weight: 400;
}
.row.mu .v {
     color: #8a99a2;
}
.row.col {
     flex-direction: column;
     align-items: flex-start;
     gap: 5px;
     padding: 12px 0;
}
.row.col .v {
     font-size: 13.5px;
     font-weight: 400;
     text-align: left;
}
.pf {
     text-align: center;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 8px;
     padding: 24px 20px 130px;
}
.pf .av {
     width: 80px;
     height: 80px;
     font-size: 26px;
     font-weight: 500;
     margin-bottom: 8px;
}
.pf p {
     font-size: 14px;
     font-weight: 500;
}
.pf small {
     color: #44565f;
     font-size: 12px;
}
.pending {
     padding: 48px 20px;
     text-align: center;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 6px;
}
.pending p {
     font-size: 15px;
     font-weight: 600;
}
.pending small {
     color: var(--mut);
     max-width: 340px;
}

/* modal / overlay */
#ov {
     position: fixed;
     inset: 0;
     background: rgba(20, 30, 40, 0.45);
     z-index: 50;
}
#modal {
     position: fixed;
     inset: 0;
     z-index: 70;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 16px;
     background: rgba(20, 30, 40, 0.5);
}
.mbox {
     width: 100%;
     max-width: 420px;
     background: #fff;
     border-radius: 18px;
     padding: 24px;
     display: flex;
     flex-direction: column;
     gap: 10px;
}
.mbox h3 {
     font-size: 17px;
     font-weight: 600;
}
.mbox p {
     color: var(--mut);
     font-size: 12.5px;
}
.mbox input {
     height: 40px;
     padding: 0 12px;
     border-radius: 10px;
     border: 1px solid #cfe0e3;
     background: #eef6f6;
     font: inherit;
}
.mact {
     display: flex;
     gap: 8px;
     justify-content: flex-end;
     margin-top: 6px;
}
.btn {
     padding: 9px 18px;
     border-radius: 10px;
     border: 1px solid #bcd9db;
     background: #e6f3f3;
     font-weight: 500;
     font-size: 12.5px;
}
.btn.p {
     background: linear-gradient(135deg, var(--ac), var(--ac2));
     border: 0;
     color: #fff;
}

@media (max-width: 1023px) {
     .top {
          display: flex;
     }
     #sb {
          position: fixed;
          inset: 0 auto 0 0;
          z-index: 60;
          width: min(86vw, 300px);
          transform: translateX(-105%);
          transition: transform 0.25s ease;
          background: #fff;
          box-shadow: 0 20px 50px rgba(20, 30, 40, 0.25);
     }
     #sb.open {
          transform: none;
     }
     .grid2,
     .stgrid,
     #t-perfil.on {
          grid-template-columns: 1fr;
     }
     .head,
     #scroll {
          padding-left: 16px;
          padding-right: 16px;
     }
     .pf {
          padding-bottom: 24px;
     }
}
@media (min-width: 1024px) {
     #ov {
          display: none !important;
     }
}
@media (prefers-reduced-motion: reduce) {
     * {
          transition: none !important;
     }
}

/* Floating back button */
.back-floating {
     position: fixed;
     top: 14px;
     left: 50%;
     transform: translateX(-50%);
     z-index: 1000;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     gap: 8px;
     width: max-content;
     max-width: calc(100vw - 24px);
     min-height: 40px;
     padding: 9px 14px;
     box-sizing: border-box;
     border: 1px solid var(--ln, #d7e2e5);
     border-radius: 999px;
     background: rgba(255, 255, 255, 0.97);
     box-shadow: 0 3px 12px rgba(23, 48, 58, 0.14);
     color: var(--tx, #17303a);
     font-family:
          Inter,
          system-ui,
          -apple-system,
          BlinkMacSystemFont,
          'Segoe UI',
          sans-serif;
     font-size: 14px;
     font-weight: 500;
     line-height: 1.2;
     white-space: nowrap;
     text-decoration: none;
     transition:
          background 0.2s ease,
          box-shadow 0.2s ease,
          transform 0.2s ease;
}
.back-floating:hover {
     background: #e6f3f3;
     box-shadow: 0 5px 16px rgba(23, 48, 58, 0.2);
}
.back-floating:focus-visible {
     outline: 3px solid rgba(0, 170, 160, 0.35);
     outline-offset: 3px;
}
.back-floating svg {
     display: block;
     width: 16px;
     height: 16px;
     flex: 0 0 16px;
}
@media (max-width: 480px) {
     .back-floating {
          top: 10px;
          min-height: 38px;
          padding: 8px 12px;
          font-size: 13px;
          gap: 6px;
     }
}
