﻿:root{
  --primary: #2563EB;
  --primary-dark: #1E3A8A;
  --bg: #EFF6FF;
  --card: #FFFFFF;
  --border: #DCEBFF;
  --text: #111827;
  --muted: #6B7280;
  --shadow: 0 14px 30px rgba(37, 99, 235, 0.16);

  --success: #22C55E;
  --info: #0EA5E9;
  --warning: #F59E0B;
  --danger: #EF4444;
}

*{ box-sizing: border-box; }
body{
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 14px;
}

/* Desktop full width */
@media (min-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }
}

.app-header{
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  padding: 26px 0 28px 0;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 18px 40px rgba(37,99,235,0.18);
}

.header-box{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 28px;
  background: rgba(255,255,255,0.08);
}

.brand-logo-img{
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgb(255 255 255);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img img{
  width: 100%;
  height: auto;
}

.brand-title{
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.brand-subtitle{
  margin: 4px 0 0 0;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
}

.header-right{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.18);
}

.status-pill{
  background: rgba(255,255,255,0.22);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.24);
  backdrop-filter: blur(10px);
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.brand-title{
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle{
  margin: 4px 0 0 0;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
}

.header-right{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill{
  background: rgba(255,255,255,0.22);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
}

.dot{
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot-success{ background: var(--success); }
.dot-info{ background: var(--info); }

.app-main{
  padding: 16px 0 90px 0;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.app-card{
  padding: 18px;
  margin-top: -18px;
}

.muted{ color: var(--muted); }
.small{ font-size: 12px; }

.btn{
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.btn-primary{ background: var(--primary); color: #fff; }
.btn-outline{
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary-dark);
}
.btn-mini{
  padding: 8px 12px;
  font-size: 12px;
  background: #F3F7FF;
  border: 1px solid var(--border);
  color: var(--primary-dark);
}
.w-100{ width: 100%; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.report-actions form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.report-actions .btn-group { display: flex; flex-wrap: wrap; gap: 10px; }
.report-title { margin: 0 0 4px 0; font-size: 20px; font-weight: 800; }
.report-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.info-box { border-radius: 18px; border: 1px solid var(--border); background: #F8FBFF; padding: 16px; text-align: center; }
.info-box h3 { margin: 0; font-size: 14px; color: var(--muted); }
.info-box strong { display: block; font-size: 22px; margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; margin-top: 12px; }
.stat-box { border-radius: 18px; border: 1px solid var(--border); background: #F8FBFF; padding: 18px; text-align: center; }
.stat-box h3 { margin: 0; font-size: 13px; color: var(--muted); }
.stat-box strong { display: block; margin-top: 10px; font-size: 22px; }
.badge-status { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-new { background: rgba(14,165,233,0.15); color: #0369A1; }
.badge-started { background: rgba(245,158,11,0.18); color: #92400E; }
.badge-done { background: rgba(34,197,94,0.15); color: #166534; }

.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  background: rgba(255,255,255,0.98);
  border-top: 1px solid rgba(220,235,255,0.95);
  border-radius: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0;
  gap: 6px;
  width: 100%;
  box-shadow: 0 -2px 15px rgba(37,99,235,0.12);
  backdrop-filter: blur(12px);
  z-index: 999;
}

.nav-item{
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 16px;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-item:hover{
  transform: translateY(-1px);
  background: rgba(37,99,235,0.06);
}

.nav-item.active{
  color: var(--primary);
  font-weight: 700;
  background: rgba(37,99,235,0.08);
}

.nav-icon{
  font-size: 18px;
}

.nav-text{
  font-size: 12px;
}

@media (min-width: 1025px) {
  body {
    padding-bottom: 70px;
  }

  .nav-item {
    min-width: 80px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .grid-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .container {
    max-width: 1200px;
    padding: 0 20px;
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
    padding: 0 30px;
  }

  .grid-stats {
    gap: 16px;
  }
}

.bottom-nav::-webkit-scrollbar {
  height: 8px;
}

.bottom-nav::-webkit-scrollbar-track {
  background: transparent;
}

.bottom-nav::-webkit-scrollbar-thumb {
  background: rgba(37,99,235,0.25);
  border-radius: 999px;
}

.bottom-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(37,99,235,0.35);
}

@media (max-width: 880px) {
  body {
    padding-bottom: 90px !important;
    padding-left: 0 !important;
  }

  main.app-main {
    padding-bottom: 120px;
  }

  .bottom-nav {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(220,235,255,0.95);
    border-radius: 0;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 8px;
    gap: 6px;
    width: 100%;
    box-shadow: 0 -2px 15px rgba(37,99,235,0.12);
    backdrop-filter: blur(12px);
    z-index: 9999;
  }

  .nav-item {
    min-width: 60px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .nav-icon {
    font-size: 18px;
  }

  .nav-text {
    font-size: 10px;
  }

  .nav-item.active{
    color: var(--primary);
    font-weight: 700;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Auth */
.auth-wrap{ display:flex; justify-content:center; padding: 10px 0; }
.auth-card{
  width: 100%;
  max-width: 420px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 18px;
}
.auth-title{ margin:0; font-size:18px; font-weight:800; }
.auth-sub{ margin:6px 0 16px 0; }

.form-group{ margin-bottom: 12px; }
.form-label{
  display:block;
  font-size:12px;
  font-weight:700;
  margin-bottom:6px;
  color: var(--primary-dark);
}
.form-input{
  width:100%;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid var(--border);
  outline:none;
  background:#F8FBFF;
}
.form-input:focus{ border-color: rgba(37,99,235,0.55); }

.link{
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}
.link:hover{ text-decoration: underline; }

/* Live layout */
.live-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.live-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Stats grid */
.grid-stats{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.stat-card{
  border-radius: 22px;
  border: 1px solid var(--border);
  background: #F8FBFF;
  padding: 18px 14px;
  text-align: center;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.stat-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-icon{
  font-size: 28px;
  display: block;
  margin: 0 auto;
}
.stat-label{
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.stat-title{
  margin: 10px 0 6px 0;
  font-size: 13px;
  font-weight: 700;
}
.stat-value{
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.stat-unit{
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.stat-sub{
  margin: 8px 0 0 0;
  font-size: 12px;
}

/* Panels */
.grid-two{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-top: 14px;
}
.panel-card{
  border-radius: 22px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 14px;
}
.panel-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.panel-title{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

/* Badges */
.badge{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success{ background: rgba(34,197,94,0.15); color: #15803D; }
.badge-info{ background: rgba(14,165,233,0.15); color: #0369A1; }
.badge-warning{ background: rgba(245,158,11,0.18); color: #92400E; }
.badge-danger{ background: rgba(239,68,68,0.15); color: #991B1B; }

/* Camera */
.camera-box{
  margin-top: 12px;
  border-radius: 18px;
  border: 1px dashed rgba(37,99,235,0.35);
  background: #F8FBFF;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera-placeholder{ text-align: center; }
.camera-icon{ font-size: 32px; }
.hint{ margin-top: 10px; }

/* Alerts */
.alerts-list{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alert-item{
  border: 1px solid var(--border);
  background: #F8FBFF;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.alert-left{
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-emoji{ font-size: 20px; }
.alert-title{
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}
.alert-sub{ margin: 3px 0 0 0; }

/* Graph box */
.graph-box{
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #F8FBFF;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Table */
.table-wrap, .table-responsive { margin-top: 12px; overflow-x: auto; }
.simple-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.simple-table th, .simple-table td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.simple-table th{
  color: var(--primary-dark);
  font-size: 12px;
}

.pill{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(14,165,233,0.15);
  color: #0369A1;
}
.pill-warn{
  background: rgba(245,158,11,0.18);
  color: #92400E;
}
.pill-danger{
  background: rgba(239,68,68,0.15);
  color: #991B1B;
}

/* Responsive */
@media (max-width: 1000px){
  .grid-stats{ grid-template-columns: repeat(2, 1fr); }
  .grid-two{ grid-template-columns: 1fr; }
}
canvas{ width:100% !important; }
/* ===== Better Responsive for Live Monitoring ===== */

/* Make main card padding smaller on mobile */
@media (max-width: 600px){
  .app-card{
    padding: 14px;
  }

  .brand-title{
    font-size: 16px;
  }

  .brand-subtitle{
    font-size: 12px;
  }

  .status-pill{
    padding: 7px 10px;
    font-size: 11px;
  }
}

/* 4 cards -> 2 cards -> 1 card */
@media (max-width: 1100px){
  .grid-stats{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px){
  .grid-stats{
    grid-template-columns: 1fr;
  }
}

/* 2 column panels -> 1 column */
@media (max-width: 1000px){
  .grid-two{
    grid-template-columns: 1fr;
  }
}

/* Buttons wrap properly */
@media (max-width: 520px){
  .live-actions{
    width: 100%;
    justify-content: space-between;
  }

  .live-actions .btn{
    flex: 1;
    text-align: center;
  }
}

/* Camera & graph height auto for small devices */
@media (max-width: 520px){
  .camera-box{
    height: 180px;
  }

  .graph-box{
    height: auto;
    padding: 10px !important;
  }
}

/* Alerts item better stacking on mobile */
@media (max-width: 520px){
  .alert-item{
    flex-direction: column;
    align-items: flex-start;
  }

  .alert-item .btn-mini{
    width: 100%;
    text-align: center;
  }
}

/* Tables / large content safe */
.table-wrap{
  overflow-x: auto;
}

/* Canvas always responsive */
canvas{
  width: 100% !important;
  height: auto !important;
}
/* Live monitoring responsive fixes */
.mini-actions{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-wrap{
  height: auto;
  padding: 12px;
}

.chart-block{
  width: 100%;
  height: 240px;
}

.chart-divider{
  height: 14px;
}

/* Better buttons wrap */
@media (max-width: 520px){
  .live-actions{
    width: 100%;
  }
  .live-actions .btn{
    flex: 1;
  }
}

/* Ensure charts don't overflow */
canvas{
  width: 100% !important;
}

/* Extra responsive improvements */
@media (max-width: 520px){
  .camera-box{
    height: 180px;
  }
  .chart-block{
    height: 220px;
  }
}
.stat-svg{
  width: 28px;
  height: 28px;
  display: inline-block;
}
.brand-logo-img img{
  height: 44px;
  width: auto;
  display: block;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}

.brand-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}

@media(max-width:520px){
  .brand-logo-img img{
    height: 38px;
  }
}

