* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f2f2f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1c1c1e;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f2f2f7;
  padding-bottom: 84px;
  position: relative;
}

/* ===== Top bar ===== */
.topbar {
  padding: 20px 16px 12px;
}
.topbar .date { font-size: 13px; color: #8e8e93; margin: 0 0 2px; }
.topbar .title { font-size: 22px; font-weight: 600; margin: 0; }

/* ===== Cards ===== */
.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 8px;
}
.stat-label { font-size: 12px; color: #8e8e93; margin: 0 0 4px; }
.stat-value { font-size: 22px; font-weight: 600; margin: 0; }

.section-label {
  font-size: 13px;
  color: #8e8e93;
  padding: 0 16px 8px;
  margin-top: 8px;
}

.list-wrap { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }

.icon-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 12px;
  height: 50px;
  font-size: 16px;
  font-weight: 600;
}
.btn-primary:active { opacity: 0.75; }
.btn-secondary {
  width: 100%;
  background: #ffffff;
  color: #007aff;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  height: 50px;
  font-size: 16px;
  font-weight: 600;
}

/* ===== Forms ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #6e6e73; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #d1d1d6;
  padding: 0 12px;
  font-size: 16px;
  background: #fff;
}

/* ===== Bottom tab bar ===== */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255,255,255,0.94);
  border-top: 1px solid #d1d1d6;
  display: flex;
  padding: 8px 0 22px;
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px;
  color: #8e8e93;
  background: none; border: none;
}
.tab-item.active { color: #007aff; }
.tab-item .tab-icon { font-size: 22px; }

/* ===== Login screen ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px;
}
.login-title { font-size: 26px; font-weight: 700; text-align: center; margin: 0 0 4px; }
.login-sub { font-size: 14px; color: #8e8e93; text-align: center; margin: 0 0 32px; }
.error-box {
  background: #fdecec; color: #c0392b;
  border-radius: 10px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 14px;
}

/* ===== Topbar with back button ===== */
.topbar-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 12px;
}
.back-btn { background: none; border: none; font-size: 22px; color: #007aff; padding: 0; }
.topbar-nav .title { font-size: 18px; font-weight: 600; margin: 0; }

.muted { color: #8e8e93; font-size: 13px; }
.pill {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
}
