*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root{
  --bg:#0b0f17;
  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.09);
  --stroke: rgba(255,255,255,.08);

  --text:#f2f5f7;
  --muted:#9aa4b2;

  --blue:#0a84ff;
  --green:#30d158;
  --orange:#ff9f0a;

  --radius:18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --blur: 18px;
}

body{
  background: radial-gradient(circle at top, #111827, #070a10);
  color:var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  min-height:100vh;
}

/* ===== NAVBAR (iOS floating glass) ===== */
.navbar{
  position:fixed;
  top:12px;
  left:12px;
  right:12px;
  height:54px;

  background:var(--glass);
  backdrop-filter: blur(var(--blur));
  border:1px solid var(--stroke);
  border-radius:16px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;

  z-index:1000;
}

.nav-title{
  font-weight:600;
  letter-spacing:2px;
  font-size:14px;
  color:var(--text);
}

.nav-time{
  font-size:12px;
  color:var(--muted);
}

/* ===== PAGE ===== */
.page{
  display:none;
  padding:90px 16px 100px;
}
.page.active{ display:block; }

/* ===== GRID ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
}

/* ===== CARD (iOS glass cards) ===== */
.card{
  background:var(--glass);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  padding:14px;

  box-shadow:var(--shadow);
  backdrop-filter: blur(var(--blur));

  transition:.2s;
}
.card:hover{
  transform:translateY(-2px);
  background:var(--glass2);
}

/* ===== STATUS CARD ===== */

.card.normal{
  border:1px solid var(--stroke);
}

.card.warning{
  border:1px solid #ff9f0a;
  box-shadow:0 0 20px rgba(255,159,10,.25);
}

.card.alarm{
  border:1px solid #ff453a;
  box-shadow:0 0 25px rgba(255,69,58,.35);
}

.card.warning p{
  color:#ff9f0a;
}

.card.alarm p{
  color:#ff453a;
}

.card h3{
  font-size:11px;
  color:var(--muted);
  margin-bottom:10px;
  letter-spacing:1px;
}

.card p{
  font-size:26px;
  font-weight:600;
}

.unit{
  font-size:11px;
  color:var(--muted);
}

/* chart full width */
.chart-card{
  grid-column:1 / -1;
  min-height:280px;
}

.chart-card canvas{
  width:100% !important;
  height:220px !important;
}

/* ===== PAGE HEADER ===== */
.page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
}

.page-header h2{
  font-size:14px;
  letter-spacing:1px;
  color:var(--text);
}

.btn-export{
  background:var(--blue);
  border:none;
  padding:8px 14px;
  border-radius:12px;
  color:white;
  font-size:12px;
}

/* ===== TABLE iOS STYLE ===== */
.table-wrap{
  border-radius:16px;
  overflow:hidden;
  border:1px solid var(--stroke);
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

thead th{
  background:rgba(255,255,255,.05);
  padding:10px;
  font-size:10px;
  color:var(--muted);
  text-align:left;
}

tbody td{
  padding:10px;
  color:var(--text);
  border-top:1px solid rgba(255,255,255,.05);
}

tbody tr:hover{
  background:rgba(255,255,255,.04);
}

.empty{
  text-align:center;
  padding:30px;
  color:var(--muted);
}

/* ========================= */
/* BOTTOM NAV IOS STYLE */
/* ========================= */

.bottom-nav{
  position:fixed;
  left:12px;
  right:12px;
  bottom:12px;

  height:72px;

  background:rgba(20,25,35,.78);
  backdrop-filter:blur(25px);

  border:1px solid rgba(255,255,255,.08);

  border-radius:24px;

  box-shadow:
    0 10px 40px rgba(0,0,0,.35);

  display:flex;
  align-items:center;
  justify-content:space-around;

  z-index:9999;
}

.tab-btn svg{
  width:22px;
  height:22px;

  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;

  transition:.25s;
}

.tab-btn{
  border:none;
  background:none;

  color:rgba(255,255,255,.55);

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  gap:5px;

  flex:1;
  height:100%;

  transition:.25s;
}

.tab-btn span{
  font-size:11px;
  font-weight:500;
}

.tab-btn.active{
  color:#ffffff;
}

.tab-btn.active svg{
  background:#0a84ff;

  width:38px;
  height:38px;

  padding:8px;
  border-radius:12px;

  box-shadow:
    0 0 15px rgba(10,132,255,.4);
}

.live-indicator{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  color:#30d158;
}

.live-indicator .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#30d158;
  animation:pulse 1.2s infinite;
}

@keyframes pulse{
  0%{
    transform:scale(1);
    opacity:1;
    box-shadow:0 0 0 0 rgba(48,209,88,.6);
  }
  70%{
    transform:scale(1.3);
    opacity:.7;
    box-shadow:0 0 0 8px rgba(48,209,88,0);
  }
  100%{
    transform:scale(1);
    opacity:1;
    box-shadow:0 0 0 0 rgba(48,209,88,0);
  }
}

.card.loading{
  position:relative;
  overflow:hidden;
}

.card.loading::after{
  content:"";
  position:absolute;
  top:0;
  left:-150%;
  width:150%;
  height:100%;
  background:linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.08),
    transparent
  );
  animation:shimmer 1.2s infinite;
}

@keyframes shimmer{
  100%{
    left:150%;
  }
}



