:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 12px;
  --touch: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
}

.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

.header {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header h1 { font-size: 1.1rem; margin: 0; flex: 1; font-weight: 600; }
.header .btn-icon {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  padding: 8px;
  min-height: var(--touch);
}

.main { flex: 1; padding: 16px; padding-bottom: 80px; max-width: 640px; margin: 0 auto; width: 100%; }

.search-hero input {
  width: 100%;
  font-size: 1.25rem;
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  min-height: 56px;
}
.search-hero input:focus {
  outline: none;
  border-color: var(--accent);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.filters select {
  flex: 1 1 45%;
  min-width: 140px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 12px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
}
.btn-primary { background: var(--accent-dim); color: #0f172a; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--surface2);
}
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card .plate { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.05em; }
.card .meta { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.card .source-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface2);
  margin-top: 8px;
}
.card a.tel {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  display: inline-block;
  margin-top: 8px;
  padding: 8px 0;
}

.list-item {
  padding: 14px;
  border-bottom: 1px solid var(--surface2);
  cursor: pointer;
}
.list-item:active { background: var(--surface2); }

.login-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  max-width: 400px;
  margin: 0 auto;
}
.login-wrap h1 { text-align: center; margin-bottom: 24px; }
.login-wrap label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }
.login-wrap input {
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.msg-empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.msg-error { color: var(--danger); padding: 12px; text-align: center; }

.admin-nav { display: grid; gap: 8px; }
.admin-nav .btn { margin-top: 0; text-align: left; justify-content: flex-start; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.data th, table.data td {
  border: 1px solid var(--surface2);
  padding: 8px;
  text-align: left;
}
table.data input, table.data select {
  width: 100%;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--surface2);
  color: var(--text);
  border-radius: 4px;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--surface2);
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}
.bottom-bar .btn { flex: 1; margin-top: 0; font-size: 0.9rem; padding: 10px; min-height: 44px; }

.hidden { display: none !important; }
