/* ============================================================
   GymBro — shell mobile-first + pantallas offline (Hoy / Entrenar)
   Se carga después de gb-app.css. Namespace .gb-*
   ============================================================ */

:root {
    --gb-tabbar-h: 62px;
    --gb-safe-b: env(safe-area-inset-bottom, 0px);
    --gb-card-bg: #fff;
    --gb-page-bg: #f3f5f9;
    --gb-shadow: 0 2px 10px rgba(24, 28, 50, .05);
    --gb-warn: #f6a609;
    --gb-warn-soft: #fff6e5;
}

/* Metronic fija `i { font-size: 1rem; color: muted }`: en los componentes nuevos
   los íconos heredan tamaño y color del contenedor. */
.gb-page i, .gb-tabbar i, .gb-sync i, .gb-sheet i, .gb-offline-note i { font-size: inherit; color: inherit; }

/* ---------- Shell ---------- */
.gb-topbar-title { font-weight: 800; font-size: 1.1rem; color: var(--gb-ink); margin-left: 10px; }

@media (max-width: 991.98px) {
    body.gb-shell { background: var(--gb-page-bg); padding-bottom: calc(var(--gb-tabbar-h) + var(--gb-safe-b)); }
    .gb-shell #kt_app_toolbar,
    .gb-shell #kt_app_footer { display: none !important; }
    .gb-shell .app-content { padding-top: 12px !important; padding-bottom: 12px !important; }
    .gb-shell #kt_app_header { box-shadow: 0 1px 0 rgba(0, 0, 0, .05); }
}

/* Barra inferior */
.gb-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--gb-tabbar-h) + var(--gb-safe-b));
    padding-bottom: var(--gb-safe-b);
    display: flex; background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--gb-line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.gb-tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: #9a9cae; font-size: .68rem; font-weight: 600; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.gb-tabbar-item.is-on { color: var(--gb-dark); }
.gb-tabbar-ico { position: relative; font-size: 1.35rem; line-height: 1; }
.gb-tabbar-item.is-on .gb-tabbar-ico i { transform: translateY(-1px); }
.gb-tabbar-live {
    position: absolute; top: -2px; right: -6px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--gb-green); box-shadow: 0 0 0 2px #fff; animation: gb-pulse 1.6s infinite;
}
@keyframes gb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Indicador de sync (header) */
.gb-sync {
    display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 999px;
    border: none; background: var(--gb-green-soft); color: var(--gb-green); font-size: .8rem; font-weight: 700;
}
.gb-sync > span { display: inline-flex; align-items: center; gap: 5px; }
.gb-sync i { font-size: 1rem; }
.gb-sync.is-pending { background: var(--gb-accent-soft); color: var(--gb-accent); }
.gb-sync.is-off { background: var(--gb-warn-soft); color: var(--gb-warn); }
.gb-sync.is-auth { background: var(--gb-danger-soft); color: var(--gb-danger); }
.gb-spin { display: inline-block; animation: gb-spin 1s linear infinite; }
@keyframes gb-spin { to { transform: rotate(360deg); } }

.gb-offline-note {
    background: var(--gb-warn-soft); color: #8a5a00; border-radius: 12px; padding: 10px 12px;
    font-size: .85rem; margin-bottom: 12px;
}
.gb-offline-note a { font-weight: 700; color: inherit; text-decoration: underline; }

/* ---------- Bloques base ---------- */
.gb-page { max-width: 640px; margin: 0 auto; }
.gb-card { background: var(--gb-card-bg); border-radius: var(--gb-radius); padding: 16px; box-shadow: var(--gb-shadow); }
.gb-section-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #7e8299; margin: 18px 4px 8px; }
.gb-label { display: block; font-size: .72rem; font-weight: 700; color: var(--gb-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.gb-count { background: #eef0f6; color: #5e6278; border-radius: 999px; padding: 1px 8px; font-size: .72rem; }
.gb-link-ico { color: #a1a5b7; font-size: 1.05rem; padding: 2px 4px; }

.gb-list { background: var(--gb-card-bg); border-radius: var(--gb-radius); box-shadow: var(--gb-shadow); overflow: hidden; }
.gb-list:empty { display: none; }
.gb-list-item {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
    background: transparent; border: 0; border-bottom: 1px solid var(--gb-line); color: var(--gb-ink);
    text-decoration: none; font-size: .95rem; -webkit-tap-highlight-color: transparent; width: 100%;
}
.gb-list > :last-child, .gb-list > :last-child .gb-list-item, .gb-list form:last-child .gb-list-item { border-bottom: 0; }
.gb-list-item:active { background: #f7f8fb; }
.gb-list-item > i:first-child { font-size: 1.15rem; width: 22px; text-align: center; }

.gb-round-ico {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
    background: #f1f3f8; color: #5e6278; font-size: 1.15rem;
}
.gb-round-ico.is-ok { background: var(--gb-green-soft); color: var(--gb-green); }
.gb-round-ico.is-warn { background: var(--gb-warn-soft); color: var(--gb-warn); }
.gb-round-ico.is-danger { background: var(--gb-danger-soft); color: var(--gb-danger); }

.gb-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center;
    color: #fff; font-size: .7rem; font-weight: 800;
}
.gb-avatar-sm { width: 22px; height: 22px; font-size: .6rem; }
.gb-avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }

.gb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; font-weight: 700; font-size: .95rem;
    text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.gb-btn:disabled { opacity: .4; }
.gb-btn-dark { background: var(--gb-dark); color: #fff; }
.gb-btn-dark:active { background: var(--gb-dark-hover); }
.gb-btn-soft { background: #fff; color: var(--gb-ink); box-shadow: var(--gb-shadow); }
.gb-btn-ghost { background: transparent; color: #5e6278; min-height: 40px; padding: 0 10px; }
.gb-btn-danger-soft { background: var(--gb-danger-soft); color: var(--gb-danger); }

.gb-input {
    width: 100%; min-height: 48px; border: 1px solid #e4e6ef; border-radius: 12px; background: #fff;
    text-align: center; font-size: 1.05rem; font-weight: 700; padding: 8px 10px; font-family: inherit; color: var(--gb-ink);
}
.gb-input:focus { outline: none; border-color: var(--gb-dark); }
textarea.gb-input { font-weight: 500; font-size: .95rem; }

.gb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gb-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
    background: #f1f3f8; color: var(--gb-ink); border: 0; font-weight: 600; font-size: .9rem;
}
.gb-chip.is-on { background: var(--gb-dark); color: #fff; }

.gb-pill { background: var(--gb-accent-soft); color: var(--gb-accent); border-radius: 999px; padding: 2px 10px; font-size: .72rem; font-weight: 700; }

/* ---------- Hojas (bottom sheets) ---------- */
.gb-sheet-wrap { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: flex-end; justify-content: center; }
.gb-sheet-bg { position: absolute; inset: 0; background: rgba(15, 16, 28, .45); }
.gb-sheet {
    position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
    background: #fff; border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + var(--gb-safe-b));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .15); animation: gb-sheet-up .22s ease-out;
}
@keyframes gb-sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.gb-sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: #e1e3ea; margin: 4px auto 10px; }
.gb-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 1.1rem; }
.gb-sheet-scroll { max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.gb-search { display: flex; align-items: center; gap: 8px; background: #f1f3f8; border-radius: 12px; padding: 0 12px; }
.gb-search input { flex: 1; border: 0; background: transparent; min-height: 46px; font-size: 1rem; outline: none; }
@media (min-width: 992px) {
    .gb-sheet-wrap { align-items: center; }
    .gb-sheet { border-radius: 22px; }
}

/* ============================================================
   HOY
   ============================================================ */
.gb-hello { margin: 4px 4px 12px; }
.gb-hello-title { font-size: 1.7rem; font-weight: 900; margin: 0; color: var(--gb-ink); }
.gb-hello-title::first-letter { text-transform: uppercase; }

.gb-days {
    display: flex; gap: 6px; overflow-x: auto; padding: 6px 8px 10px; margin: 0 -8px 6px;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gb-days::-webkit-scrollbar { display: none; }
.gb-day {
    flex: 0 0 46px; height: 74px; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--gb-shadow);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 8px; gap: 2px;
    scroll-snap-align: center; color: var(--gb-ink); position: relative; -webkit-tap-highlight-color: transparent;
}
.gb-day-wd { font-size: .66rem; font-weight: 700; color: var(--gb-muted); }
.gb-day-n { font-size: 1.1rem; font-weight: 800; line-height: 1.1; }
.gb-day-marks { display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 12px; font-size: 9px; flex-wrap: wrap; padding: 0 3px; }
.gb-day-dot { width: 5px; height: 5px; border-radius: 50%; }
.gb-day.is-gym { background: var(--gb-green); color: #fff; }
.gb-day.is-gym .gb-day-wd { color: rgba(255, 255, 255, .8); }
.gb-day.is-gym .gb-day-dot { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.gb-day.is-gym .gb-day-marks i { text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.gb-day.is-today:not(.is-sel) { box-shadow: inset 0 0 0 2px var(--gb-dark); }
.gb-day.is-sel { box-shadow: 0 0 0 2px var(--gb-page-bg), 0 0 0 4px var(--gb-dark); }

.gb-train {
    display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; margin-bottom: 4px;
    background: var(--gb-dark); color: #fff !important; text-decoration: none; box-shadow: 0 8px 24px rgba(27, 27, 41, .25);
}
.gb-train-ico { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; font-size: 1.6rem; flex-shrink: 0; }
.gb-train-t { font-weight: 800; font-size: 1.15rem; }
.gb-train-s { font-size: .82rem; color: rgba(255, 255, 255, .7); }
.gb-train-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: #6ff5a1; }
.gb-train.is-live { background: linear-gradient(135deg, #1b1b29, #12452c); }
.gb-train.is-live .gb-train-ico { background: var(--gb-green); }
.gb-train-go { background: #fff; color: var(--gb-dark); border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.gb-note-ok { background: var(--gb-green-soft); color: #0f8a3c; border-radius: 14px; padding: 12px 14px; font-weight: 700; }

.gb-check { min-height: 58px; }
.gb-check-box {
    width: 28px; height: 28px; border-radius: 9px; border: 2.5px solid; display: grid; place-items: center;
    color: transparent; flex-shrink: 0; transition: background .15s; font-size: 1.1rem;
}
.gb-page .gb-check-box i { color: transparent; }
.gb-page .gb-check.is-on .gb-check-box i { color: #fff; }
.gb-check.is-on .gb-check-box { color: #fff; }
.gb-check.is-on .flex-grow-1 { color: #7e8299; }
.gb-check-tag { font-size: .7rem; font-weight: 800; color: var(--gb-green); text-transform: uppercase; }

.gb-week { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 4px; }
.gb-week > * {
    background: #fff; border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--gb-shadow);
    display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--gb-ink); text-decoration: none;
}
.gb-week b { font-size: 1.4rem; font-weight: 900; line-height: 1.1; }
.gb-week i { font-size: 1.4rem; }
.gb-week span { font-size: .7rem; color: var(--gb-muted); font-weight: 600; }

/* ============================================================
   ENTRENAR
   ============================================================ */
.gb-routines { display: flex; flex-direction: column; gap: 10px; }
.gb-routine {
    display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px; border: 0; border-radius: 18px;
    background: #fff; box-shadow: var(--gb-shadow); color: var(--gb-ink); -webkit-tap-highlight-color: transparent;
}
.gb-routine:active { transform: scale(.99); }
.gb-routine-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--gb-dark); color: #fff; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.gb-routine.is-free { background: transparent; box-shadow: inset 0 0 0 2px #e1e3ea; }
.gb-routine.is-free .gb-routine-ico { background: #f1f3f8; color: var(--gb-ink); }

.gb-done { background: #fff; border-radius: 20px; padding: 22px 16px; text-align: center; box-shadow: var(--gb-shadow); margin-bottom: 22px; }
.gb-done-ico { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%; background: #fff6d6; color: #f0b400; display: grid; place-items: center; font-size: 1.8rem; }
.gb-done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gb-done-stats > div { background: #f6f7fb; border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; }
.gb-done-stats b { font-size: 1.2rem; font-weight: 900; }
.gb-done-stats span { font-size: .7rem; color: var(--gb-muted); font-weight: 600; }

.gb-clockbar {
    position: sticky; top: calc(var(--bs-app-header-height, 60px) + 6px); z-index: 20;
    display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; margin-bottom: 10px;
    background: var(--gb-dark); color: #fff; border-radius: 18px; box-shadow: 0 8px 20px rgba(27, 27, 41, .2);
}
.gb-clockbar.is-paused { background: #5b4a1a; }
.gb-clockbar-k { font-size: .72rem; color: rgba(255, 255, 255, .65); font-weight: 600; }
.gb-clockbar-t { font-size: 1.7rem; font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.gb-clockbar.is-paused .gb-clockbar-t { animation: gb-pulse 1.2s infinite; }
.gb-clockbar-btn {
    height: 44px; min-width: 44px; border-radius: 13px; border: 0; background: rgba(255, 255, 255, .14); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 1.3rem; padding: 0 10px;
}
.gb-clockbar-btn span { font-size: .85rem; }
.gb-clockbar-btn.is-finish { background: var(--gb-danger); font-size: 1rem; }
.gb-clockbar-btn.is-ghost { background: transparent; min-width: 32px; padding: 0 4px; }

.gb-people { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; padding: 2px; }
.gb-people::-webkit-scrollbar { display: none; }
.gb-person {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 6px;
    border: 0; border-radius: 999px; background: #fff; box-shadow: var(--gb-shadow); font-weight: 700; font-size: .85rem; color: var(--gb-ink);
}
.gb-person.is-on { box-shadow: inset 0 0 0 2px var(--gb-dark); }
.gb-person.is-add { padding: 0 12px; color: #5e6278; background: transparent; box-shadow: inset 0 0 0 1.5px #d8dae3; }

.gb-workout .gb-tabs { margin: 0 -2px 10px; padding: 2px 2px 6px; scrollbar-width: none; }
.gb-workout .gb-tabs::-webkit-scrollbar { display: none; }
.gb-workout .gb-tab { min-height: 42px; }
.gb-tab.is-done:not(.active) { background: var(--gb-green-soft); color: #0f8a3c; }
.gb-tab.is-add { background: transparent; box-shadow: inset 0 0 0 1.5px #d8dae3; color: #5e6278; }
.gb-workout .gb-tab.active { background: var(--gb-dark); }

.gb-excard { padding: 14px; }
.gb-exname { font-size: 1.35rem; font-weight: 900; line-height: 1.2; color: var(--gb-ink); }
.gb-cols-s { grid-template-columns: 34px 1fr 1.1fr .8fr; }
.gb-cols-w { grid-template-columns: 34px 30px 1fr 1.1fr .8fr; }
.gb-workout .gb-setrow { border: 1px solid var(--gb-line); min-height: 52px; -webkit-tap-highlight-color: transparent; }
.gb-workout .gb-setrow:active { transform: scale(.99); }

.gb-notes-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0; padding: 12px 14px; border: 0;
    border-radius: 14px; background: transparent; color: #7e8299; font-size: .9rem; box-shadow: inset 0 0 0 1.5px #e1e3ea; text-align: left;
}

/* Logger fijo abajo: queda pegado arriba de la barra de pestañas */
.gb-logger {
    position: sticky; bottom: calc(var(--gb-tabbar-h) + var(--gb-safe-b) + 8px); z-index: 25;
    background: #fff; border-radius: 22px; padding: 10px; margin-top: 10px;
    box-shadow: 0 -4px 30px rgba(24, 28, 50, .14), 0 0 0 1px var(--gb-line);
}
@media (min-width: 992px) { .gb-logger { bottom: 12px; } }
.gb-logger-for { font-size: .82rem; color: var(--gb-ink); text-align: center; margin-bottom: 8px; }
.gb-logger-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; margin-bottom: 8px; }
.gb-stepper { display: flex; align-items: stretch; background: #f3f5f9; border-radius: 16px; overflow: hidden; height: 60px; }
.gb-stepper > button {
    width: 44px; flex-shrink: 0; border: 0; background: transparent; font-size: 1.2rem; color: var(--gb-ink);
    -webkit-tap-highlight-color: transparent;
}
.gb-stepper > button:active { background: #e6e9f1; }
.gb-page .gb-stepper > button i { color: var(--gb-ink); }
.gb-stepper label { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gb-stepper input {
    width: 100%; border: 0; background: transparent; text-align: center; font-size: 1.55rem; font-weight: 900;
    font-variant-numeric: tabular-nums; padding: 0; line-height: 1.1; color: var(--gb-ink); -moz-appearance: textfield;
}
.gb-stepper input::-webkit-outer-spin-button, .gb-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gb-stepper input:focus { outline: none; }
.gb-stepper label span { font-size: .62rem; font-weight: 700; color: var(--gb-muted); text-transform: uppercase; }

.gb-logbtn-xl {
    width: 100%; height: 58px; border: 0; border-radius: 16px; background: var(--gb-green); color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.1rem; font-weight: 800;
    box-shadow: 0 6px 16px rgba(23, 198, 83, .35); -webkit-tap-highlight-color: transparent;
}
.gb-logbtn-xl:active { transform: scale(.98); background: #12a846; }
.gb-logbtn-xl i { font-size: 1.4rem; }
.gb-logbtn-prev { font-size: .75rem; font-weight: 600; opacity: .85; background: rgba(0, 0, 0, .12); border-radius: 999px; padding: 2px 8px; }

.gb-rest {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px; height: 44px;
    margin-bottom: 8px; border-radius: 14px; background: #eef6ff; padding: 0 6px 0 12px; color: #1b4d8f;
}
.gb-rest-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(62, 151, 255, .18); transition: width .25s linear; }
.gb-rest-t { position: relative; flex: 1; font-size: .92rem; }
.gb-rest-t b { font-size: 1.1rem; }
.gb-rest-b { position: relative; border: 0; background: #fff; border-radius: 10px; height: 34px; padding: 0 10px; font-weight: 700; font-size: .8rem; color: #1b4d8f; }
.gb-rest.is-done { background: var(--gb-green); color: #fff; font-weight: 800; animation: gb-pulse .5s 3; }

/* Hay un logger flotando: dejar aire al final del contenido */
.gb-workout.has-logger { padding-bottom: 8px; }

/* Banner "¿Activar notificaciones?": arriba de la barra de pestañas, debajo de las hojas */
.gb-push-banner { bottom: 20px; width: max-content; max-width: calc(100vw - 24px); }
@media (max-width: 991.98px) {
    .gb-push-banner { bottom: calc(var(--gb-tabbar-h) + var(--gb-safe-b) + 10px) !important; }
}
