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

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #0f3460;
  --accent: #00d4ff;
  --accent-dim: #0097b2;
  --text: #e8e8e8;
  --text-dim: #8899aa;
  --danger: #e94560;
  --success: #00c853;
  --warn: #ffab00;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 16px;
}
header h1 { font-size: 1.3rem; font-weight: 600; }
header .status {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--surface);
}
header .status.ok { color: var(--success); }
header .status.err { color: var(--danger); }

/* Quick Create */
.quick-create {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.quick-create h2 {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.create-row {
  display: flex;
  gap: 8px;
}
.create-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 1rem;
}
.create-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.create-row input::placeholder { color: var(--text-dim); }
.create-row select {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: 10px 8px;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 60px;
}
.btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-danger { background: var(--danger); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.suffix {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.suffix span { color: var(--accent); }

/* Filter tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text-dim);
  border: none;
}
.tab.active {
  background: var(--accent);
  color: var(--bg);
}

/* Alias cards */
.alias-list { display: flex; flex-direction: column; gap: 8px; }

.alias-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.alias-card:active { background: var(--surface2); }
.alias-card.blocked { opacity: 0.5; }

.alias-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alias-name {
  font-weight: 600;
  font-size: 1rem;
}
.alias-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.alias-badge.active { background: rgba(0,200,83,0.15); color: var(--success); }
.alias-badge.blocked { background: rgba(233,69,96,0.15); color: var(--danger); }
.alias-badge.subaddress { background: rgba(255,171,0,0.15); color: var(--warn); }

.alias-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Expanded alias details */
.alias-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bg);
}
.alias-details .field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.alias-details .field label { color: var(--text-dim); }
.alias-details .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 100;
  animation: fadeInOut 2.5s ease;
}
.toast.error { border-left: 3px solid var(--danger); }
.toast.success { border-left: 3px solid var(--success); }

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty .icon { font-size: 2rem; margin-bottom: 8px; }

/* Search */
.search {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  margin-bottom: 12px;
}
.search:focus { outline: none; border-color: var(--accent); }

/* Loading */
.loading { text-align: center; padding: 20px; color: var(--text-dim); }
