:root {
  --bg: #1A1A2E;
  --surface: #1F2244;
  --surface-2: #262B55;
  --border: #2E335E;
  --accent: #16C79A;
  --accent-soft: rgba(22, 199, 154, 0.15);
  --text: #EAEAEA;
  --text-dim: #9999B0;
  --status-live: #16C79A;
  --status-ready: #3B82F6;
  --status-waiting: #F59E0B;
  --radius: 18px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(22,199,154,0.08), transparent 60%),
    radial-gradient(60% 40% at 0% 100%, rgba(59,130,246,0.06), transparent 60%),
    var(--bg);
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: calc(72px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(26, 26, 46, 0.85);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px 8px;
}

.topbar__inner h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.topbar__meta {
  font-size: 12px;
  color: var(--text-dim);
}

.search {
  padding: 6px 14px 10px;
}

.search input {
  width: 100%;
  height: var(--tap);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}

.search input::placeholder { color: var(--text-dim); }
.search input:focus { border-color: var(--accent); }

.filters {
  display: flex;
  gap: 8px;
  padding: 4px 14px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.main {
  flex: 1;
  padding: 8px 14px 24px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
  text-decoration: none;
  color: inherit;
  min-height: 88px;
  transition: transform 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}

.card:active { transform: scale(0.985); border-color: var(--accent); }

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), #0FA67D);
  letter-spacing: 0.5px;
}

.card__body { min-width: 0; }

.card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card__name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}

.badge.live { background: rgba(22,199,154,0.18); color: var(--status-live); }
.badge.ready { background: rgba(59,130,246,0.18); color: var(--status-ready); }
.badge.waiting { background: rgba(245,158,11,0.18); color: var(--status-waiting); }

.card__mission {
  font-size: 13px;
  color: var(--text-dim);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card__meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

.card__chev {
  color: var(--text-dim);
  font-size: 22px;
}

.detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail__head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.detail__head .avatar {
  width: 72px;
  height: 72px;
  font-size: 28px;
  border-radius: 22px;
}

.detail__title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.section h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.section p { font-size: 15px; color: var(--text); }

.section ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.section li {
  font-size: 15px;
  color: var(--text);
  padding-left: 18px;
  position: relative;
}

.section li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 8px;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 15px;
}

.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: rgba(26,26,46,0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 60px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
}

.tab__icon { font-size: 18px; }

.tab.is-active { color: var(--accent); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.kpi__num {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.kpi__label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
