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

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #1a1a1a;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  background: #fff;
}

button:hover {
  background: #f0f0f0;
}

button.primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

button.primary:hover {
  background: #333;
}

input,
select {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid #1a1a1a;
  outline-offset: -1px;
}

/* Login form */
.login-form {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form h2 {
  margin: 0;
}

/* Tracker elements */
caffeine-tracker,
checkin-tracker {
  display: block;
}

caffeine-tracker + checkin-tracker {
  margin-top: 1rem;
}

/* Trackers (shared) */
.caffeine-tracker,
.checkin-tracker {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
}

.caffeine-tracker h2,
.checkin-tracker h2 {
  margin: 0 0 1rem;
}

.caffeine-form,
.checkin-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.caffeine-form select,
.caffeine-form input,
.checkin-form input {
  flex: 1;
  min-width: 0;
}

.caffeine-entries,
.checkin-entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.caffeine-entries li,
.checkin-entries li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid #eee;
}

.caffeine-entries .drink {
  text-transform: capitalize;
}

.caffeine-entries time,
.checkin-entries time {
  color: #666;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.caffeine-entries .empty,
.checkin-entries .empty {
  color: #999;
  text-align: center;
  padding: 1rem 0;
  border-top: none;
}

.error {
  color: #c00;
  font-size: 0.875rem;
  margin: 0.5rem 0;
}
