:root {
  /* Väripaletti: Vaaleansininen & Valkoinen */
  --bg-main: #f0f5f9;
  --sidebar-blue: #1e3a8a; /* Syvänsininen kontrastiin tai vaaleampi alta */
  --accent-blue: #0ea5e9;
  --light-blue: #e0f2fe;
  --white: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
}

/* Header & Navigointi */
header {
  background: var(--white);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  color: var(--accent-blue);
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

nav {
  background: var(--white);
  padding: 0.5rem 2rem;
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav button {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

nav button.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Pääsisältö */
main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* Listaukset ja kohteet */
.item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item:last-child { border-bottom: none; }

.pill {
  background: var(--light-blue);
  color: var(--accent-blue);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Painikkeet */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.2s;
}

.btn.primary {
  background: var(--accent-blue);
  color: white;
}

.btn.secondary {
  background: var(--white);
  border-color: var(--border);
  color: var(--text-main);
}

/* Debug-paneelin tyylit (että ne eivät riko ulkoasua) */
/* .debugFab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
}

.debugPanel {
  position: fixed;
  top: 0; right: 0; width: 400px; height: 100vh;
  background: #1a1a1a; color: #0f0;
  font-family: monospace; font-size: 12px;
  z-index: 2000; overflow-y: auto; padding: 10px;
} */

/* --- Modaalit ja Overlay --- */

/* Himmennetty tausta */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5); /* Tumma sinertävä läpinäkyvyys */
  backdrop-filter: blur(4px); /* Kevyt sumennus taustalle */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

/* Itse modaali-ikkuna */
.modal {
  background: var(--white);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modalin osat */
.modal header {
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.modal .body {
  padding: 1.5rem;
  overflow-y: auto;
}

/* Aputyylit modaalin sisälle */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: end;
}

/* Yhteenvetokortit (Note) */
.note {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  flex: 1;
}

.badge {
  background: var(--accent-blue);
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Lomake-elementit */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

input {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  font-size: 1rem;
  color: var(--text-main);
  box-sizing: border-box;
}

input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--light-blue);
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

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

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.small {
  font-size: 0.8rem;
}