body.tiki-panel {
  background: var(--tiki-bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.app {
  --nav: 248px;
  position: relative;
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr);
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--tiki-white);
  border-bottom: 1px solid var(--tiki-border);
  box-shadow: inset 0 -2px 0 var(--tiki-green);
}

.app-bar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.15rem;
  border-right: 1px solid var(--tiki-border);
}

.app-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.app-brand img {
  display: block;
  height: 30px;
  width: auto;
  max-width: 148px;
}

.app-bar__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0 1.75rem;
}

.app-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.15rem;
  padding: 0 1rem;
  border-radius: 8px;
  background: var(--tiki-green);
  color: var(--tiki-navy);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.app-who {
  max-width: 14rem;
  overflow: hidden;
  color: var(--tiki-navy);
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-salir {
  color: var(--tiki-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}
.app-salir:hover { color: var(--tiki-navy); }

.app-menu {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--tiki-border);
  border-radius: 8px;
  background: var(--tiki-white);
  cursor: pointer;
}

.app-menu__bar {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 99px;
  background: var(--tiki-navy);
}

.app-body {
  display: contents;
}

.app-nav {
  grid-column: 1;
  background: var(--tiki-white);
  border-right: 1px solid var(--tiki-border);
}

.app-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.1rem 0.75rem;
}

.app-link {
  display: block;
  padding: 0.68rem 0.9rem;
  border-radius: 8px;
  color: var(--tiki-navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.app-link:hover { background: var(--tiki-bg); }
.app-link.is-active {
  background: var(--tiki-bg);
  border-left-color: var(--tiki-green);
}

.app-main {
  grid-column: 2;
  min-width: 0;
  width: 100%;
  padding: 1.6rem 1.75rem 2.75rem;
}

.app-main__inner {
  width: 100%;
  max-width: none;
}

.form h3 {
  margin: 1.6rem 0 0.85rem;
  padding: 0 0 0.55rem;
  border-bottom: 1px solid var(--tiki-border);
  color: var(--tiki-navy);
  font-size: 0.95rem;
  font-weight: 700;
}
.form h3:first-child { margin-top: 0; }

.page-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.page-sub {
  margin: 0 0 1.35rem;
  color: var(--tiki-muted);
  overflow-wrap: anywhere;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.2rem;
}

.tabs {
  display: flex;
  gap: 0.15rem;
  margin: 0 0 1.2rem;
  border-bottom: 1px solid var(--tiki-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--tiki-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tabs__btn.is-on {
  color: var(--tiki-navy);
  border-bottom-color: var(--tiki-green);
}

.tabs__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9a227;
}

.pass-wrap {
  position: relative;
}

.pass-wrap input { padding-right: 2.7rem; }

.pass-toggle {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tiki-muted);
  cursor: pointer;
}

.pass-toggle:hover { color: var(--tiki-navy); background: var(--tiki-bg); }

.pass-meter { margin-top: 0.55rem; }

.pass-meter__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.pass-meter__bars i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: var(--tiki-border);
}

.pass-meter[data-score="1"] .pass-meter__bars i.is-on { background: #c45c5c; }
.pass-meter[data-score="2"] .pass-meter__bars i.is-on { background: #c9a227; }
.pass-meter[data-score="3"] .pass-meter__bars i.is-on,
.pass-meter[data-score="4"] .pass-meter__bars i.is-on { background: var(--tiki-green); }

.pass-meter__label,
.pass-match {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--tiki-muted);
}

.pass-match { color: #b42318; }
.pass-match--ok { color: #0b7a55; }

.notice {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.notice--ok { background: #edfdf7; border: 1px solid #b6eed8; }
.notice--err { background: #fff4f4; border: 1px solid #f0c7c7; }
.notice--warn { background: #fff8e8; border: 1px solid #f0e0b0; }

.cards {
  --cols: 4;
  --gap: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-bottom: 1.4rem;
}

.cards > * {
  flex: 1 1 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 0;
  width: auto;
}

.card {
  background: var(--tiki-white);
  border: 1px solid var(--tiki-border);
  border-radius: 8px;
  padding: 1.15rem 1.2rem;
  min-width: 0;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tiki-muted);
}

.card .num {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.card p { margin: 0.4rem 0 0; color: var(--tiki-muted); font-size: 0.9rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.split > .card { width: auto; }

.delta {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.delta--up { color: #0b7a55; }
.delta--down { color: #9b2c2c; }
.delta--flat { color: var(--tiki-muted); }

.num--sm { font-size: 1.25rem; }

.bar-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  min-height: 1rem;
  color: var(--tiki-muted);
  font-size: 0.68rem;
}

.bar-axis span {
  flex: 1 1 0;
  text-align: center;
  overflow: hidden;
}

.chart--bars { min-height: 120px; }

.share-list { display: flex; flex-direction: column; gap: 0.85rem; }

.share__top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.share__bar {
  height: 6px;
  margin: 0.4rem 0 0.25rem;
  border-radius: 99px;
  background: var(--tiki-bg);
  overflow: hidden;
}

.share__bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--tiki-green);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.1rem;
}

.mini-table p {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--tiki-border);
  font-size: 0.86rem;
}

.mini-table p:last-child { border-bottom: 0; }

.example {
  margin: 0.8rem 0 0;
  padding: 1rem 1.05rem;
  border-radius: 8px;
  background: var(--tiki-navy);
  color: #fff;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.card code {
  font-size: 0.82em;
}

.stat-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem 0;
}

.stat-list p { margin: 0; }

.table-wrap {
  width: 100%;
  max-width: 100%;
  background: var(--tiki-white);
  border: 1px solid var(--tiki-border);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--tiki-border);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tiki-muted);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--tiki-bg);
  color: var(--tiki-navy);
}

.badge--ok { background: #d8f8ee; }
.badge--warn { background: #fff1c9; }
.badge--off { background: #eceff3; color: var(--tiki-muted); }

.form,
.card {
  width: 100%;
  max-width: 100%;
}

.form {
  background: var(--tiki-white);
  border: 1px solid var(--tiki-border);
  border-radius: 8px;
  padding: 1.5rem 1.6rem 1.65rem;
}

.form-grid {
  --cols: 3;
  --gap: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem var(--gap);
}

.form-grid > * {
  flex: 1 1 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 0;
  max-width: 100%;
}

.form-grid > .full {
  flex: 1 1 100%;
}

label.lbl {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tiki-muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 2.7rem;
  border: 1px solid var(--tiki-border);
  border-radius: 8px;
  padding: 0 0.85rem;
  color: var(--tiki-navy);
  background: #fff;
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2309224A' d='M1.2 1.4L6 6.2l4.8-4.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 8px;
}

select::-ms-expand { display: none; }

textarea { height: auto; min-height: 90px; padding: 0.7rem 0.85rem; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tiki-navy);
  box-shadow: 0 0 0 4px rgba(9, 34, 74, 0.08);
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 0.15rem;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--tiki-navy);
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.switch__ui {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #DCE4EC;
  transition: background 0.16s ease;
}

.switch__ui:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(9, 34, 74, 0.22);
  transition: transform 0.16s ease;
}

.switch input:checked + .switch__ui {
  background: var(--tiki-green);
}

.switch input:checked + .switch__ui:after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch__ui {
  box-shadow: 0 0 0 3px rgba(1, 220, 162, 0.35);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.1rem;
  min-width: 0;
}

.actions input,
.actions select {
  flex: 1 1 160px;
  width: auto;
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0 1.1rem;
  border-radius: 12px;
  border: 0;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary { background: var(--tiki-green); color: var(--tiki-navy); }
.btn-secondary { background: #fff; color: var(--tiki-navy); border: 1px solid var(--tiki-border); }
.btn-danger { background: #fff; color: #9b2c2c; border: 1px solid #f0c7c7; }

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--tiki-muted);
}

.home-hero {
  width: calc(100% - 2rem);
  max-width: 720px;
  margin: 8vh auto;
  background: var(--tiki-white);
  border: 1px solid var(--tiki-border);
  border-radius: 16px;
  padding: 2.2rem 1.4rem 2.6rem;
  text-align: center;
}

.home-hero--narrow { max-width: 560px; }

.home-hero img {
  height: 56px;
  width: auto;
  max-width: 80%;
}
.home-hero h1 {
  margin: 1.2rem 0 0.4rem;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.home-hero p { margin: 0 0 1.4rem; color: var(--tiki-muted); font-size: 1.05rem; }
.home-hero .cta { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
  width: 100%;
  margin: 0 0 1rem;
}

.filters > * {
  flex: 1 1 180px;
  min-width: 0;
}

.filters input,
.filters select {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
}

.filters .btn { width: 100%; }

.copyrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.copyrow input { flex: 1 1 200px; min-width: 0; }

.chart {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 140px;
  display: block;
}

.muted { color: var(--tiki-muted); font-size: 0.9rem; overflow-wrap: anywhere; }

.stack-gap { margin-bottom: 1rem; }

@media (max-width: 1200px) {
  .form-grid { --cols: 2; }
}

@media (max-width: 1100px) {
  .cards { --cols: 2; }
}

@media (min-width: 721px) {
  .filters .btn { width: auto; min-width: 7.5rem; }
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
  }
  .app-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .app-bar__brand {
    border-right: 0;
    padding: 0 0.7rem 0 0.85rem;
  }
  .app-menu { display: flex; }
  .app-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(248px, 86vw);
    border-right: 1px solid var(--tiki-border);
    box-shadow: 8px 0 24px rgba(9, 34, 74, 0.08);
  }
  .app.is-nav-open .app-nav { display: block; }
  .app-main { grid-column: 1; padding: 1rem 0.85rem 2rem; }
  .app-who { display: none; }
  .app-bar__tools {
    gap: 0.65rem;
    padding: 0 0.85rem 0 0;
  }
  .app-cta {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.75rem;
  }
  .form-grid { --cols: 2; --gap: 0.75rem; }
  .cards { gap: 0.65rem; }
  .card { padding: 0.9rem 0.85rem; }
  .card .num { font-size: 1.25rem; }
  .split { gap: 0.65rem; margin-bottom: 1rem; }
  .switch-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }
  .page-title { font-size: 1.35rem; }
}

@media (max-width: 640px) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > * { flex-basis: calc(50% - 0.35rem); }
  .form { padding: 0.95rem 0.9rem; }
  .actions { flex-wrap: wrap; }
  .actions .btn { flex: 1 1 calc(50% - 0.4rem); width: auto; }
  table { min-width: 560px; }
  th, td { padding: 0.7rem 0.75rem; }
  .chart { min-height: 110px; }
}
