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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #000;
  color: #fff;
  min-height: 100vh;
  padding-bottom: 100px;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 500px;
  margin: 0 auto;
}

.header {
  padding: 16px 20px 8px;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
}

.dashboard {
  padding: 0 12px 20px;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #888;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #30d158;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Cards */
.card {
  background: #1c1c1e;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

/* KPI Card */
.kpi-value {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: #30d158;
}

.kpi-subtitle {
  font-size: 14px;
  color: #8e8e93;
  text-align: center;
  margin-bottom: 12px;
}

.kpi-subtitle .icon {
  margin-right: 4px;
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: #2c2c2e;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
  width: 0;
}

.progress-green { background: #30d158; }
.progress-red { background: #ff453a; }
.progress-yellow { background: #ffd60a; }
.progress-orange { background: #ff9f0a; }

/* Operators section */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.section-header .icon {
  font-size: 22px;
}

.operator-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.operator-name {
  width: 130px;
  font-size: 13px;
  color: #e5e5ea;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-bar-wrapper {
  flex: 1;
  margin: 0 12px;
}

.operator-bar {
  height: 10px;
  background: #2c2c2e;
  border-radius: 5px;
  overflow: hidden;
}

.operator-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease-out;
  width: 0;
}

.operator-value {
  font-size: 14px;
  color: #8e8e93;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* Overdue section */
.overdue-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.overdue-title {
  font-size: 18px;
  font-weight: 600;
}

.overdue-total {
  font-size: 22px;
  font-weight: 700;
  color: #ff453a;
  margin-left: auto;
}

.overdue-card {
  background: #1c1c1e;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  border-left: 3px solid #ff453a;
}

.overdue-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.overdue-row:last-child {
  margin-bottom: 0;
}

.overdue-name {
  flex: 1;
  font-size: 13px;
  color: #e5e5ea;
}

.overdue-bar-wrapper {
  width: 120px;
  margin: 0 12px;
}

.overdue-bar {
  height: 8px;
  background: #2c2c2e;
  border-radius: 4px;
  overflow: hidden;
}

.overdue-fill {
  height: 100%;
  border-radius: 4px;
  background: #ff453a;
  transition: width 1s ease-out;
  width: 0;
}

.overdue-value {
  font-size: 14px;
  color: #8e8e93;
  min-width: 40px;
  text-align: right;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #1c1c1e;
  border-top: 1px solid #2c2c2e;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #8e8e93;
  font-size: 10px;
  gap: 2px;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-item.active {
  color: #0a84ff;
}

.nav-icon {
  font-size: 22px;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
}

/* Update time */
.update-time {
  text-align: center;
  color: #636366;
  font-size: 12px;
  padding: 8px 0 4px;
}
