/* --- Nav --- */
#nav {
  display: none;
}

#nav.nav--visible {
  display: block;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav__brand {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav__link {
  color: var(--color-text-muted);
  font-weight: 500;
}

.nav__link--active {
  color: var(--color-primary);
}

.nav__logout {
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.nav__logout:hover {
  color: var(--color-danger);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-btn);
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.05s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn--primary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

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

.btn--ghost:hover {
  background: var(--color-primary-light);
  text-decoration: none;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--large {
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
}

.btn--chip {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border: none;
  padding: 0.6rem 1rem;
}

.chip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-text);
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.chip--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.chip--add {
  color: var(--color-text-muted);
}

/* --- Forms --- */
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
}

.input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
}

/* --- Toast --- */
.toast-root {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.toast {
  background: var(--color-toast-bg);
  color: #fff;
  border: 1px solid var(--color-border);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90vw;
}

.toast--success {
  background: var(--color-success);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 32, 30, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
}

.modal__presets {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.modal__actions .btn {
  flex: 1;
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: var(--radius-card);
  }
}

/* --- Stat tiles --- */
.stat-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 0.9rem;
  text-align: center;
}

.stat-tile span {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.stat-tile strong {
  font-size: 1.15rem;
}
