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

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border-red: #c62828;
  --border-red-soft: #e57373;
  --primary: #b71c1c;
  --error: #b00020;
  --shadow: rgba(198, 40, 40, 0.12);
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

body {
  margin: 0;
  min-height: 100dvh;
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100dvh;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px var(--shadow);
}

.login-card {
  max-width: 400px;
  margin: 2rem auto;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.app-title {
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"],
input[type="tel"] {
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  border: 2px solid transparent;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--border-red);
}

.btn.primary:active {
  filter: brightness(0.95);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--border-red-soft);
}

.btn.danger {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--border-red);
}

.btn.full-width {
  width: 100%;
  margin-top: 0.75rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.top-bar {
  max-width: 520px;
  margin: 0 auto 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.top-bar .btn {
  margin-left: auto;
}

.main-menu {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  border: 3px solid var(--border-red);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.menu-row:active {
  transform: scale(0.995);
}

.menu-row-label {
  flex: 1;
}

.menu-row-icon {
  flex-shrink: 0;
  color: var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 500px) {
  .modal {
    align-items: center;
    padding: 1rem;
  }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 90dvh;
  overflow: auto;
  margin-top: auto;
  border-radius: 16px 16px 0 0;
  border: 3px solid var(--border-red);
  border-bottom: none;
}

@media (min-width: 500px) {
  .modal-sheet {
    margin-top: 0;
    border-radius: 12px;
    border-bottom: 3px solid var(--border-red);
  }
}

.modal-sheet-wide {
  max-width: 480px;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.plate-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.plate-list li {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.65rem;
  background: #fff8f8;
  border: 1px solid var(--border-red-soft);
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.plate-list li:last-child {
  margin-bottom: 0;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #333;
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  max-width: 90vw;
}

.toast.hidden {
  display: none;
}
