[hidden] { display: none !important; }
:root {
  --vihrea: #2e7d32; --vihrea-tumma: #1b5e20; --harmaa: #f4f5f3; --reuna: #d9ddd6; --teksti: #1f2a1f;
  --punainen: #c62828; --keltainen: #f9a825; --sininen: #1565c0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--teksti);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; }
header { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px;
  background: var(--vihrea-tumma); color: #fff; }
.otsikko { font-size: 18px; font-weight: 600; }
.otsikko small { font-weight: 400; opacity: .8; margin-left: 8px; font-size: 13px; }
.logo { background: #fff; color: var(--vihrea-tumma); border-radius: 4px; padding: 1px 6px; margin-right: 4px; }
.kayttaja { font-size: 13px; display: flex; gap: 10px; align-items: center; }
.kayttaja button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 4px;
  padding: 3px 8px; cursor: pointer; }
main { flex: 1; display: flex; min-height: 0; }
aside { width: 400px; max-width: 45vw; overflow-y: auto; padding: 12px 16px; background: var(--harmaa);
  border-right: 1px solid var(--reuna); display: flex; flex-direction: column; gap: 6px; }
#kartta { flex: 1; }
h2 { font-size: 15px; margin: 10px 0 8px; display: flex; justify-content: space-between; align-items: center; }
section { border-bottom: 1px solid var(--reuna); padding-bottom: 10px; }
.pieni { font-size: 12px; color: #555; }
.pudotus { border: 2px dashed #a5b3a2; border-radius: 8px; padding: 12px; text-align: center; background: #fff; }
.pudotus.yli { border-color: var(--vihrea); background: #eef7ee; }
.pudotus p { margin: 4px 0; }
.napit { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.nappi, button { font: inherit; font-size: 13px; }
.nappi { display: inline-block; padding: 5px 10px; border: 1px solid var(--vihrea); color: var(--vihrea-tumma);
  border-radius: 4px; cursor: pointer; background: #fff; }
.nappi:hover { background: #eef7ee; }
button.ensisijainen { width: 100%; margin-top: 10px; padding: 9px; background: var(--vihrea); color: #fff;
  border: 0; border-radius: 4px; cursor: pointer; font-weight: 600; }
button.ensisijainen:disabled { background: #9aa79a; cursor: not-allowed; }
.pieni-nappi { border: 1px solid var(--reuna); background: #fff; border-radius: 4px; cursor: pointer; padding: 1px 7px; }
.projektikortti { background: #fff; border: 1px solid var(--reuna); border-radius: 6px; padding: 8px 10px; margin-top: 10px; }
.merkki { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #e3f2fd;
  color: var(--sininen); text-transform: uppercase; letter-spacing: .5px; }
.aineistot { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.aineistot li { padding: 2px 0; }
.aineistot .ok::before { content: "✓ "; color: var(--vihrea); font-weight: 700; }
.aineistot .puuttuu::before { content: "✗ "; color: var(--punainen); font-weight: 700; }
.aineistot .puuttuu { color: var(--punainen); }
.varoitus { color: var(--punainen); font-size: 12px; margin: 6px 0 0; }
.asetukset { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; }
.asetukset label { display: grid; gap: 2px; }
.asetukset input, .asetukset select, #projValinta { font: inherit; padding: 4px 6px; border: 1px solid var(--reuna);
  border-radius: 4px; width: 100%; }
.tila { font-size: 13px; margin-top: 8px; }
.tyolista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tyo { background: #fff; border: 1px solid var(--reuna); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.tyo .rivi { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.tyo .nimi { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tyo .aika { color: #666; font-size: 12px; white-space: nowrap; }
.tyo .viesti { color: #444; margin-top: 3px; }
.tyo .virhe { color: var(--punainen); margin-top: 3px; white-space: pre-wrap; }
.tyo .toiminnot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tyo .toiminnot button { border: 1px solid var(--reuna); background: #fff; border-radius: 4px; padding: 2px 8px; cursor: pointer; }
.tyo .toiminnot button.paa { border-color: var(--vihrea); color: var(--vihrea-tumma); }
.tyo.valittu { outline: 2px solid var(--vihrea); }
.palkki { height: 6px; background: #e6e9e4; border-radius: 3px; overflow: hidden; margin-top: 5px; }
.palkki > div { height: 100%; background: var(--vihrea); transition: width .5s; }
.tilamerkki { font-size: 11px; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.t-valmis { background: #e8f5e9; color: var(--vihrea-tumma); }
.t-virhe { background: #ffebee; color: var(--punainen); }
.t-peruttu { background: #eceff1; color: #555; }
.t-kesken { background: #fff8e1; color: #8d6e00; }
footer { margin-top: auto; padding-top: 8px; }
dialog { max-width: 90vw; width: 900px; border: 1px solid var(--reuna); border-radius: 8px; }
dialog pre { max-height: 65vh; overflow: auto; background: #111; color: #e0e0e0; padding: 10px; font-size: 12px; }
.ilmoitus { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #263238; color: #fff;
  padding: 10px 16px; border-radius: 6px; font-size: 14px; z-index: 2000; max-width: 80vw; }
.ilmoitus.virhe { background: var(--punainen); }
.selite { background: #fff; padding: 6px 8px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 12px; line-height: 18px; }
.selite i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: middle; opacity: .8; }
@media (max-width: 800px) {
  main { flex-direction: column; }
  aside { width: 100%; max-width: none; max-height: 55vh; border-right: 0; border-bottom: 1px solid var(--reuna); }
  #kartta { min-height: 45vh; }
}
.aineistot .varoitus { color: #8a5a00; }
.aineistot .varoitus::before { content: "⚠ "; }
.aineistot .varoitus select { max-width: 100%; margin-top: 2px; }
