/* Reset, theme tokens, base typography, top-bar.
 * Loaded first — every other module depends on these tokens.
 */

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

html {
  -webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

img,
picture {
  max-width: 100%;
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

:root {
  --color-bg: #f5f7f6;
  --color-surface: #ffffff;
  --color-text: #1a2e25;
  --color-text-muted: #5b6e66;
  --color-primary: #0a7c5a;
  --color-primary-dark: #075e44;
  --color-secondary: #2d6a9f;
  --color-secondary-dark: #1f4d75;
  --color-border: #d4dbd8;
  --color-danger: #c43c3c;
  --color-warning: #d18b1a;
  --color-success: #0a7c5a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: var(--color-primary);
  color: white;
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.brand {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Logged-in user + logout button in the header. */
.top-bar__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.top-bar__username {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.9;
}

.top-bar form {
  margin: 0;
}

/* The logout button sits on the green header, so it needs light text. */
.top-bar .btn--ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.55);
}