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

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --tier1: #f59e0b;
  --tier2: #3b82f6;
  --tier3: #64748b;
  --border: #334155;
  --radius: 12px;
  --radius-sm: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  padding-top: var(--safe-top);
  padding-bottom: calc(64px + var(--safe-bottom));
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100vh;
}

/* Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-item.active, .nav-item:hover {
  color: var(--accent);
}

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

/* Header */
.page-header {
  padding: 20px 0 12px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

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

/* Search */
.search-container {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 8px 0 12px;
  background: var(--bg);
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

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

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

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 16px;
  pointer-events: none;
}

.search-wrapper {
  position: relative;
}

/* Filter pills */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Cards */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.card:hover, .card:active {
  background: var(--bg-card-hover);
}

.card-name {
  font-size: 16px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tier-1 { background: rgba(245, 158, 11, 0.15); color: var(--tier1); }
.tier-2 { background: rgba(59, 130, 246, 0.15); color: var(--tier2); }
.tier-3 { background: rgba(100, 116, 139, 0.15); color: var(--tier3); }

/* Profile page */
.profile-header {
  padding: 16px 0 20px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.profile-title {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 2px;
}

.profile-company {
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  margin-top: 2px;
}

.profile-company:hover { text-decoration: underline; }

.info-section {
  margin-bottom: 20px;
}

.info-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.info-section-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

/* Company profile */
.company-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.company-name {
  font-size: 24px;
  font-weight: 700;
}

.people-count {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

/* Event cards */
.event-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid var(--accent);
}

.event-card:hover { background: var(--bg-card-hover); }

.event-name {
  font-size: 18px;
  font-weight: 600;
}

.event-date {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.event-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.event-stat-value {
  font-weight: 600;
  color: var(--text);
}

/* Import section */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.import-zone:hover, .import-zone.dragover {
  border-color: var(--accent);
}

.import-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.import-text {
  font-size: 15px;
  color: var(--text-muted);
}

.import-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Utility */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 15px;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.fade-in {
  animation: fadeIn 0.2s ease-out;
}

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

/* Toggle / tabs */
.tab-row {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.form-field {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.form-input:focus { border-color: var(--accent); }

/* Responsive tweaks for larger screens */
@media (min-width: 768px) {
  #app { padding: 0 24px; }
  .card-list { gap: 10px; }
}
