:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273449;
  --border: #334155;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 8px;
}

header.appbar .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

header.appbar .brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

header.appbar .sub {
  font-size: 48px;
  line-height: 1.1;
  color: #1e3a8a;
  font-weight: 700;
}

header.appbar .logout-btn {
  color: var(--accent-dark);
}

main {
  flex: 1;
  padding: 16px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.screen { display: none; }
.screen.active { display: block; }

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: 14px 0 6px;
}

input[type="text"], input[type="password"], input[type="number"], input[type="email"], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
}

input:focus, select:focus { outline: 2px solid var(--accent); }

.password-field {
  position: relative;
}

.password-field input {
  padding-inline-end: 44px;
}

.toggle-password-btn {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password-btn:active { color: var(--text); background: var(--surface); }

.results-coords {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

button {
  font-size: 15px;
  border: none;
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: white;
  width: 100%;
  margin-top: 18px;
}

button.primary:active { background: var(--accent-dark); }

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  padding: 6px 10px;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.suggestions {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  overflow: hidden;
  background: var(--surface-2);
}

.suggestion-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active { background: var(--surface); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  margin-top: 8px;
}

.chip button {
  padding: 0;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
}

.business-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: 10px;
  cursor: pointer;
}

.business-card:active { background: var(--surface-2); }

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

.business-info { flex: 1; }
.business-name { font-weight: 600; font-size: 15px; }
.business-status { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 30px 10px;
  font-size: 14px;
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.actions-row button { flex: 1; }

.banner {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 14px;
}
.banner.info { background: rgba(59,130,246,0.15); border: 1px solid var(--accent); }
.banner.error { background: rgba(239,68,68,0.15); border: 1px solid var(--danger); color: #fecaca; }
.banner.success { background: rgba(34,197,94,0.15); border: 1px solid #22c55e; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.record-card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.record-card .rec-title { font-weight: 600; }
.record-card .rec-meta { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.record-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 15px;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}
.record-btn.recording { animation: pulse 1.2s infinite; }
.record-btn:disabled { opacity: 0.5; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  70% { box-shadow: 0 0 0 20px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.center { text-align: center; }

.login-logo {
  max-width: 260px;
  width: 80%;
  background: #ffffff;
  border-radius: var(--radius);
  padding: 16px 20px;
}

footer.tabbar {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
