/*
 * Global layout and table styles for the products UI.
 */

:root {
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --border: #e2e2e2;
  --row-alt: #fafafa;
  --accent: #1652d8;
  --alert-bg: #fde8e8;
  --alert-fg: #9b1c1c;
  --notice-bg: #e6f4ea;
  --notice-fg: #1e4620;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  line-height: 1.45;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.app-header .app-name {
  font-weight: 600;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-header .current-email {
  color: var(--muted);
  font-size: 0.9rem;
}

.logout-form button {
  background: none;
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.login {
  max-width: 360px;
  margin: 4rem auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.login-form .field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.login-form input {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

.login-form input[type="submit"] {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.flash {
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.flash--alert {
  background: var(--alert-bg);
  color: var(--alert-fg);
}

.flash--notice {
  background: var(--notice-bg);
  color: var(--notice-fg);
}

[data-controller="filter"] input[type="search"] {
  width: 100%;
  max-width: 360px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 1rem;
  font: inherit;
}

table.products {
  width: 100%;
  border-collapse: collapse;
}

table.products thead th {
  text-align: left;
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

table.products tbody tr:nth-child(even) {
  background: var(--row-alt);
}

table.products td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.products td.price {
  text-align: right;
  white-space: nowrap;
}

table.products td.last-seen {
  white-space: nowrap;
  color: var(--muted);
}

table.products tr.ignored {
  opacity: 0.55;
}

.ignore-form {
  display: inline;
}

.toggle {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: white;
  font: inherit;
}

.toggle--on {
  background: var(--alert-bg);
  color: var(--alert-fg);
  border-color: var(--alert-fg);
}
