:root {
  --bg:            #f8fafc;
  --text:          #0f172a;
  --muted:         #64748b;
  --primary:       #3b82f6;
  --primary-600:   #2563eb;
  --primary-700:   #1d4ed8;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --ring:          rgba(37, 99, 235, .35);

  --nav-bg:        #111827;
  --nav-text:      #ffffff;
  --nav-muted:     #d1d5db;

  --radius:        12px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08);
}

/* ========== Base / Reset ==========*/
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
p  { margin: 0 0 .75rem; color: var(--muted); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ========== Navbar ==========*/
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  background: var(--nav-bg);
  color: var(--nav-text);
  position: relative;
}

.navbar .nav a {
  color: var(--nav-muted);
  margin-left: 1rem;
}
.navbar .nav a:hover { color: var(--nav-text); }

.navbar__right { display: flex; align-items: center; }
.navbar__right .btn { margin-left: .5rem; }

.user-chip {
  display: inline; 
  color: #fff;
  margin-right: .5rem;
}

/* ========== Buttons ==========*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .5rem 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #e5e7eb;
  color: #111827;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .04s ease;
}
.btn:hover    { background: #d1d5db; }
.btn:active   { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-600); }
.btn--primary:active { background: var(--primary-700); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.navbar .btn--ghost {
  color: #fff;
  border-color: rgba(255,255,255,.25);
}

.btn--lg { padding: .75rem 1.25rem; font-size: 1.06rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }


.btn + .btn { margin-left: .5rem; }

/* ========== Cards ==========*/
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}
.card h3 { margin-top: 0; color: var(--text); }
.card__link { display: inline-block; margin-top: .75rem; font-weight: 600; }

/* ========== Forms ==========*/
label { display: block; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
label input, label textarea { margin-top: .375rem; }

input, textarea {
  width: 100%;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* ========== Hero ==========*/
.hero {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 3rem 1.25rem;
  text-align: center;
  margin-bottom: 2rem;
}
.hero h1 { font-size: 2.2rem; margin-bottom: .75rem; }
.hero p  { max-width: 720px; margin: 0 auto 1.2rem; }
.hero .btn + .btn { margin-left: .75rem; }

/* ========== Cards Grid ==========*/
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* ========== Lists ==========*/
.list { display: grid; gap: 1rem; }

/* ========== Flash Messages ==========*/
.flash {
  max-width: 960px;
  margin: 1rem auto 0;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #164e63;
}

/* ========== Footer ==========*/
.footer {
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ========== Small Screens ==========*/
@media (max-width: 640px) {
  .navbar .nav a { margin-left: .75rem; }
  .hero { padding: 2rem 1rem; }
  .btn--lg { width: 100%; }
  .hero .btn + .btn { margin-left: 0; margin-top: .5rem; }
}
