:root {
  --tp-green: #009b54;
  --tp-green-dark: #007a43;
  --tp-ink: #07142f;
  --tp-muted: #667085;
  --tp-border: #edf0f2;
  --tp-bg: #f8faf9;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: calc(78px + var(--safe-top));
}

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html { min-height: 100%; background: var(--tp-bg); }
body {
  min-height: 100%; margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tp-ink);
  background: var(--tp-bg);
}

.app-phone {
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: rgba(255,255,255,.98);
  position: relative;
  overflow-x: hidden;
}

.app-header {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  z-index: 60;
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: 10px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226,232,240,.72);
}

.app-content {
  padding-top: calc(var(--header-height) + 16px);
  padding-bottom: calc(104px + var(--safe-bottom));
}

.app-footer {
  padding-bottom: calc(10px + var(--safe-bottom));
  box-shadow: 0 -18px 50px rgba(15, 23, 42, .08);
}

.soft-card {
  background: #fff;
  border: 1px solid rgba(226,232,240,.88);
  box-shadow: 0 12px 28px rgba(15,23,42,.055);
}

.soft-button {
  background: #fff;
  border: 1px solid rgba(226,232,240,.92);
  box-shadow: 0 10px 22px rgba(15,23,42,.07);
}

.solid-green { background: var(--tp-green); }
.solid-green-dark { background: var(--tp-green-dark); }
.text-brand { color: var(--tp-green); }
.bg-brand-soft { background: #e9f8f1; }
.status-optimo { background: #e8f8ef; color: #00884a; }
.status-bajo { background: #fff3dc; color: #e08700; }
.status-critico { background: #ffe8e5; color: #e03126; }

.bar-track { height: 5px; border-radius: 999px; background: #edf0f2; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

@media (max-width: 380px) {
  :root { --header-height: calc(72px + var(--safe-top)); }
  .app-header { padding-left: 14px !important; padding-right: 14px !important; }
  .brand-logo { width: 42px !important; height: 42px !important; }
  .brand-title { font-size: 16px !important; }
  .brand-ruc { font-size: 11px !important; }
  .header-action { width: 36px !important; height: 36px !important; }
  .header-profile { display: none !important; }
  .app-content { padding-left: 14px !important; padding-right: 14px !important; }
}

@media (min-width: 768px) {
  .app-phone {
    margin-top: 18px; margin-bottom: 18px;
    border-radius: 34px;
    border: 1px solid rgba(226,232,240,.9);
    box-shadow: 0 28px 80px rgba(15,23,42,.12);
  }
  .app-header { border-top-left-radius: 34px; border-top-right-radius: 34px; }
}
