/* Johdon työkalu: työpöytäkäyttö, tiheämpi kuin kuljettajien mobiilinäkymä. */
:root {
  --vihrea: #1b5e20;
  --vihrea-vaalea: #e8f5e9;
  --punainen: #c62828;
  --punainen-vaalea: #ffebee;
  --keltainen: #fff8e1;
  --oranssi: #f9a825;
  --harmaa: #f5f5f5;
  --raja: #ddd;
  --teksti: #1a1a1a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--teksti);
  background: #fff;
}

header {
  background: var(--vihrea);
  color: #fff;
  padding: 0.7rem 1.2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.brand { font-weight: 600; font-size: 1.05rem; }
header nav { display: flex; gap: 1.2rem; align-items: center; }
header nav a { color: #fff; text-decoration: none; opacity: 0.9; }
header nav a:hover { opacity: 1; text-decoration: underline; }
header nav form { margin: 0; }
button.linkki {
  background: none; border: 0; color: #fff; text-decoration: underline;
  font-size: 1rem; cursor: pointer; padding: 0;
}

main { padding: 1.2rem; max-width: 78rem; margin: 0 auto; }

h1 { font-size: 1.5rem; margin: 0.3rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
.pieni { font-size: 0.85rem; color: #666; }
.ok-teksti { color: var(--vihrea); }

/* Poikkeusryhmät: väri kertoo kiireellisyyden yhdellä silmäyksellä */
.ryhma {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  border-left: 6px solid var(--raja);
  background: var(--harmaa);
}
.ryhma.punainen { border-left-color: var(--punainen); background: var(--punainen-vaalea); }
.ryhma.keltainen { border-left-color: var(--oranssi); background: var(--keltainen); }
.ryhma h2 { margin-top: 0.2rem; display: flex; align-items: center; gap: 0.6rem; }
.ryhma ul { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.ryhma li { padding: 0.45rem 0; border-top: 1px solid rgba(0,0,0,0.07); }

.lkm {
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-size: 0.85rem;
}
.iso-lkm { background: var(--punainen); color: #fff; }

.kortti { border-radius: 10px; padding: 0.9rem 1rem; margin: 0.8rem 0; background: var(--harmaa); }
.kortti.ok { background: var(--vihrea-vaalea); border-left: 5px solid var(--vihrea); }
.kortti.punainen-kortti { background: var(--punainen-vaalea); border-left: 5px solid var(--punainen); }
.kortti ul { margin: 0.4rem 0 0; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--raja); vertical-align: top; }
thead th { background: var(--harmaa); font-size: 0.85rem; }
tr.estetty { background: #fffdfa; }
table.tiedot { max-width: 40rem; }
table.tiedot th { width: 12rem; font-weight: 600; }

.tagi {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--raja);
}
.tagi.sahkoposti { background: #e3f2fd; }
.tagi.whatsapp { background: var(--vihrea-vaalea); }
.tagi.rahtikirja { background: var(--keltainen); }
.tagi.confirmed { background: var(--vihrea-vaalea); }
.tagi.unmatched { background: var(--punainen-vaalea); }
.tagi.pending { background: var(--keltainen); }

.suodattimet { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.suodattimet select, .suodattimet input, .suodattimet button {
  padding: 0.45rem 0.6rem; border: 1px solid var(--raja); border-radius: 6px; font-size: 0.95rem;
}
.suodattimet button { background: var(--vihrea); color: #fff; border: 0; cursor: pointer; }

.lomake { display: flex; flex-direction: column; gap: 0.3rem; max-width: 34rem; margin-top: 1rem; }
.lomake label { font-weight: 600; margin-top: 0.7rem; }
.lomake input, .lomake select {
  padding: 0.6rem; font-size: 1rem; border: 1px solid var(--raja); border-radius: 6px;
}
button.iso {
  background: var(--vihrea); color: #fff; border: 0; padding: 0.75rem;
  border-radius: 8px; font-size: 1rem; font-weight: 600; margin-top: 0.9rem; cursor: pointer;
}

.virhe { background: var(--punainen-vaalea); color: var(--punainen); padding: 0.8rem; border-radius: 8px; }

.palstat { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.palstat > div { flex: 1 1 22rem; min-width: 0; }
.rk-kuva { max-width: 100%; border: 1px solid var(--raja); border-radius: 6px; }

.rk-lista { list-style: none; padding: 0; }
.rk-lista li { padding: 0.4rem 0; border-bottom: 1px solid var(--raja); }

/* Lajiteltavat sarakeotsikot */
th.lajiteltava { padding: 0; }
th.lajiteltava a {
  display: block; padding: .5rem .6rem;
  color: inherit; text-decoration: none; white-space: nowrap;
}
th.lajiteltava a:hover { background: rgba(0,0,0,.06); }
.nuoli { margin-left: .3rem; font-size: .75em; }

/* Poisto: tarkoituksella vaisu. Näkyy kun sitä etsii, ei houkuttele
   ohimennen - poisto on lopullinen toimenpide. */
.poistolomake { margin-top: 2rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
button.poista {
  background: none; border: 1px solid #c0392b; color: #c0392b;
  padding: .4rem .8rem; border-radius: 4px; cursor: pointer; font-size: .9rem;
}
button.poista:hover { background: #c0392b; color: #fff; }
.kuittauslomake { display: inline; margin-left: .5rem; }
