/* PLIDEGAS — Bulma v1 Custom CSS Variables + Android Adaptive Material 3 Layout */
:root {
  --bulma-primary-h: 171deg;
  --bulma-primary-s: 100%;
  --bulma-primary-l: 41%;
  --bulma-link-h: 210deg;
  --bulma-link-s: 78%;
  --bulma-link-l: 54%;
  --bulma-radius: 14px;
  --bulma-radius-large: 18px;
  --plidegas-gold: #F59E0B;
  --plidegas-surface: #ffffff;
  --plidegas-surface-2: #f5f7fb;
  --plidegas-border: rgba(15, 23, 42, 0.1);
  --plidegas-nav-h: 64px;
  --plidegas-rail-w: 256px;
}

html[data-theme="dark"] {
  --bulma-scheme-main: #0B1220;
  --bulma-scheme-main-bis: #111A2E;
  --bulma-scheme-main-ter: #18233C;
  --bulma-background: #111A2E;
  --bulma-border: #22304D;
  --bulma-text: #E2E8F0;
  --bulma-text-strong: #F8FAFC;
  --plidegas-surface: #111A2E;
  --plidegas-surface-2: #18233C;
  --plidegas-border: rgba(148, 163, 184, 0.16);
}

html, body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.brand-name {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.15rem;
  background: linear-gradient(135deg, #00D1B2 0%, #38BDF8 55%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(circle at top right, rgba(0, 209, 178, 0.16), transparent 45%),
              radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.12), transparent 45%);
}
.login-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--plidegas-border);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.app-navbar {
  border-bottom: 1px solid var(--plidegas-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.app-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

.desktop-rail {
  width: var(--plidegas-rail-w);
  flex-shrink: 0;
  border-right: 1px solid var(--plidegas-border);
  background: var(--plidegas-surface);
  padding: 1.25rem 0.9rem;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: none;
}

@media (min-width: 1024px) {
  .desktop-rail {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 1rem 1rem calc(var(--plidegas-nav-h) + 2.25rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  .app-main {
    padding: 1.5rem 2rem 2.5rem;
  }
}

.rail-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  text-align: left;
  margin-bottom: 0.25rem;
}
.rail-btn:hover { background: rgba(0, 209, 178, 0.1); }
.rail-btn.is-active { background: rgba(0, 209, 178, 0.2); color: #00D1B2; }

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--plidegas-surface);
  border-top: 1px solid var(--plidegas-border);
  padding: 0.35rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

@media (min-width: 1024px) {
  .mobile-bottom-nav, .mobile-fab { display: none !important; }
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-height: 48px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem;
}
.bnav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  transition: background 0.18s ease, transform 0.15s ease;
}
.bnav-item.is-active { opacity: 1; color: #00D1B2; }
.bnav-item.is-active .bnav-pill { background: rgba(0, 209, 178, 0.2); }

.mobile-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--plidegas-nav-h) + 1.15rem + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  border-radius: 16px !important;
  box-shadow: 0 10px 26px rgba(0, 209, 178, 0.38);
  height: 52px;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

.card {
  border: 1px solid var(--plidegas-border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card.signal-card:hover { border-color: rgba(0, 209, 178, 0.5); }
.card.signal-hot { border-color: #00D1B2; box-shadow: 0 0 0 2px rgba(0, 209, 178, 0.25); }
.card.signal-warn { border-color: rgba(245, 158, 11, 0.55); }

.kpi-value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; }

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00D1B2;
  box-shadow: 0 0 0 3px rgba(0, 209, 178, 0.28);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.88); }
}

.view-section { display: none; }
.view-section.is-active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-stack {
  position: fixed;
  top: 4.25rem;
  right: 1rem;
  z-index: 90;
  width: min(380px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plidegas-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}
.plidegas-switch input {
  width: 44px;
  height: 24px;
  appearance: none;
  background: #475569;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
.plidegas-switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.plidegas-switch input:checked { background: #00D1B2; }
.plidegas-switch input:checked::after { transform: translateX(20px); }
