:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --ink: #2b2a28;
  --muted: #8a8678;
  --accent: #d97757;
  --accent-dark: #b85f43;
  --border: #e4e1d8;
  --green: #5b8a6e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}

#auth-screen .card { width: 100%; max-width: 380px; }

h1 { margin: 0 0 4px; font-size: 1.5rem; }
h2 { margin: 0 0 16px; font-size: 1.1rem; }
.subtitle { color: var(--muted); margin: 0 0 20px; font-size: 0.92rem; }

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg); border-radius: 10px; padding: 4px; }
.tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
.tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.auth-form { display: flex; flex-direction: column; gap: 10px; }

.password-field { position: relative; display: flex; }
.password-field input { flex: 1; padding-right: 40px; }
.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
}
.toggle-password:hover { opacity: 1; }

input, select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

button {
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
}

.auth-form button, .add-item-form button {
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  border: none;
}
.auth-form button:hover, .add-item-form button:hover { background: var(--accent-dark); }

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 12px;
}
.ghost:hover { background: var(--bg); }

.primary {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 14px;
}
.primary:hover { background: #486f58; }
.primary:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.error { color: #c0392b; font-size: 0.85rem; min-height: 1em; margin: 0; }
.hint { color: var(--muted); font-size: 0.8rem; margin: -4px 0 0; }
.text-link { color: var(--accent); font-size: 0.85rem; text-align: center; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.invite-banner {
  background: #fff8ee;
  border: 1px solid #f0deba;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  color: #6b5a32;
}

.add-item-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.add-item-form input { flex: 1; min-width: 160px; }

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: none; }

.item-name { font-weight: 600; flex: 1; min-width: 100px; }

.item-status { color: var(--muted); font-size: 0.85rem; }
.item-status.pending { color: var(--accent-dark); font-weight: 600; }

.item-controls { display: flex; align-items: center; gap: 8px; }

.delete-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4px 8px;
}
.delete-btn:hover { color: #c0392b; }

.empty-state { color: var(--muted); text-align: center; padding: 24px 0; }
