body {
    display: flex;
    justify-content: center;
    flex-direction: column;
    background-color: #2f3846;
    align-items: center; /* keskittää kaiken sisällön */
    margin: 0;
}

.charts {
    display: flex;
    gap: 20px;
    justify-content: space-evenly;
    flex-wrap: wrap; /* sallii rivinvaihdon pienillä näytöillä */
   
    width: 100%;
    padding: 20px;
}

canvas {

    border-radius: 8px;
    max-width: 300px;
    max-height: 300px;
    width: 100%;
    height: 100%;
}

#pylvasChart {
    flex: 1 1 900px;
    max-width: 1200px;
    min-width: 640px;
    height: 420px;
    max-height: none;
    display: block;
    margin: 0 auto;
}

.nappi-container {

  flex-wrap: nowrap;
  flex-direction: row;
}

table {
    border-collapse: separate;
    border-spacing: 0;        
    margin: 20px auto;         
    border-radius: 15px;      
    box-shadow: 0 4px 15px rgba(148, 111, 194, 0.3); 
    overflow: hidden;       
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

th, td {
    padding: 10px;
    text-align: center;
}

th {
    background-color: #c9a6f3; /* vähän tummempi kuin td */
    color: #2f3846;
    font-weight: 500;
    border-right: #ede1fb solid 1px;
}

tbody tr:nth-child(even) td {
    background-color: #f3e9fe;
}

tbody tr:nth-child(odd) td {
    background-color: #eadcfb;
}

tbody tr:nth-child(even) th {
    background-color: #f3e9fe; /* tummempi th:n jokatoinen */
    color: #2f3846;
}

tbody tr:nth-child(odd) th {
    background-color: #eadcfb; /* vaaleampi th:n jokatoinen */
    color: #2f3846;
}

th {
    background: #c9a6f3;
    color: #2f3846; /* hieman vaaleampi valkoinen */
    font-weight: 400;  /* kevyempi kuin normaali 600 */
    font-size: 14px;
    letter-spacing: 0.05em; /* hieman ilmavuutta */
}

tr:nth-child(even) td {
    background-color: #f8f0fc;
}

tr:nth-child(odd) td {
    background-color: #ede1fb;
}

tr:hover td {
    background-color: #d8c4ff; /* Hover-efekti riville */
    transition: background-color 0.3s ease;
}

.yhteenveto-rivi th, 
.yhteenveto-rivi td {
    background: #c9a6f3 !important;           /* sama tumma violetti kuin th:llä */
    color: #2f3846 !important;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 10px;
    border-top: solid 1px #ede1fb;

}
.yhteenveto-tulot th,
.yhteenveto-tulot td{

    background: #c9a6f3 !important; 
  border-top: solid 1px #ede1fb;
  cursor: pointer;
 
}

.yhteenveto-tulot th:hover {
  background-color: #906bbd !important;        
}

.erittely td {
  font-weight: bold;

}


.tapahtuma-lista {
  max-height: 0;
  max-width: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, max-width 1s ease;
  white-space: nowrap;
}

.tapahtuma-lista.avaa {
  max-height: 500px;
  max-width: 600px;;
}

.tapahtumalista {
  list-style: none;
  padding: 0.5rem;
  margin: 0;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

.tapahtumalista li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.tapahtumalista li:last-child {
  border-bottom: none;
}

.tapahtumalista .paiva {
  flex: 1;
  color: #555;
}

.tapahtumalista .saaja {
  flex: 2;
  color: #333;
  font-weight: 500;
}

.tapahtumalista .summa {
  flex: 1;
  text-align: right;
  font-weight: 600;
}
.summa:hover {
    background-color: #b49cd1;
    transition: background-color 0.3s ease;
}

.summa-kentta {
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px;
    padding: 6px 12px;
    transition: background-color 0.3s ease;
}



.popup-overlay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.popup {
  background-color: #f3e9fe;
  border-radius: 18px;
  border: solid #946fc2 3px;
  padding: 16px;
  width: 320px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: sans-serif;
}

.close-button {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #444;
}

.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.popup-info {
  font-size: 0.75rem;
  color: #555;
  text-align: center;
  margin-top: 10px;
}

  .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #946fc2;
    background: none;
    border: none;
    cursor: pointer;
  }

.site-header {
  width: 100%;
  background-color: #1f252f;
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Sisältö keskitetysti ja leveys hallinnassa */
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Vasen, keskellä ja oikea osio eroteltuna */
  gap: 20px;
}

.logo-container {
  flex: 0 0 auto;
  margin-left: 5%;
}

/* Logo-kuva */
.logo-img {
      width: 50px;
}

.main-nav {
  flex: 1 1 auto; /* Vie kaiken keskelle jäävän tilan */
  display: flex;
  justify-content: center;
  color: white;
  font-size: 19px;
}


/* Navigaatio */
.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
}

.main-nav ul li a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

.flash-messages {
    margin: 10px auto;
    width: 90%;
    max-width: 400px;
    padding: 10px;
    background-color: #ffdddd;
    border: 1px solid #dd4444;
    border-radius: 4px;
    color: #a00;
}

.flash-message {
    margin-bottom: 5px;
}

/* Lomake */
.upload-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-form input[type="file"] {
  color: white;
}

.upload-form, .button {
  flex: 0 0 auto;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
}

button,
.button,
input[type="submit"] {
  background: linear-gradient(135deg, #c9a6f3, #a37bde);
  border: 1px solid #b68de4;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(148, 111, 194, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
  background: linear-gradient(135deg, #b68de4, #946fc2);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(148, 111, 194, 0.32);
}

.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Täysi näkymäkorkeus vain tälle osalle */

}

.sivun-otsikko {
    display: flex;
    color: white;
    flex: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: stretch;
    align-items: center;
    justify-content: space-between;
}

.sivun-otsikko i {
  cursor: pointer;
  font-size: 40px;
}

.sivun-otsikko i:hover {
  cursor: pointer;
  font-size: 50px;
}

.login-container {
  background: #fff;
  padding: 2.5rem 3rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  width: 350px;
  text-align: center;
}

    .login-container img {
      width: 100px;
      margin-bottom: 1.5rem;
    }

    h1 {
      margin-bottom: 1.5rem;
      color: #ffffff;
      font-weight: 600;
    }

    h2 {
      margin-bottom: 1.5rem;
      color: #ffffff;
      font-weight: 600;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
     
      padding: 0.75rem 1rem;
      margin-bottom: 1.2rem;
      border: 1.5px solid #ddd;
      border-radius: 8px;
      font-size: 1rem;
      transition: border-color 0.3s;
    }

    input[type="text"]:focus,
    input[type="password"]:focus {
      
      outline: none;
    }

    form button {
      width: 100%;
    }

     .form-container {
    display: flex;
    flex-direction: row;
    align-items: center;
  
    border-radius: 75px;
    width: 100%;
   
    flex: 1 1 calc(25% - 20px);
  
    align-items: flex-start;

    
}

.form-card {
    background-color: white;
    padding: 20px;
    border: 1px solid #d4d3d3;
    border-radius: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1 1 calc(25% - 20px);
    box-sizing: border-box;
    margin: 2%;

  }
  
  
  .formcarryForm label {
    display: block;
    padding: 12px 0 2px 0;
    letter-spacing: -0.2px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
  }

  .formcarryForm button {
    margin-top: 5px;
    width: 100%;
  }
  
  .formcarryForm input,
  .formcarryForm textarea {
    background-color: #fff;
    border: 1px solid #d4d3d3;
    border-radius: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 2%;
    width: 90%;
  
  }
  
  .formcarryForm input:focus,
  .formcarryForm textarea:focus {
    background-color: #fff;
   
  }
  
  .formcarry-alert {
    padding: 12px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    margin-top: 12px;
    display: none;
  }
  
  .formcarry-alert.visible {
    display: block;
  }
  
  .formcarry-alert.success {
    background: #69cf9d;
  }
  
  .formcarry-alert.error {
    background: #de524c;
  }

  .sivu-container {

    height: 100vh;
    width: 70%;
    gap: 2rem;

  }

  .sivupalkki {
    width: 200px;
    padding: 1rem;
    left: 0px;
    position: absolute;
  }

  .sivupalkki button {
    display: block;
    margin-bottom: 1rem;
    width: 40%;
    height: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
  }

  .sivupalkki button i {
    font-size: 30px;
  }

  .sisalto {
    padding: 2rem;

  }

  #vasen-paneeli {
    width: 50%;
  }

  #oikea-paneeli {
    margin-left: 15%;
    flex-grow: 1;
  }

#kategoriat {
  display: flex;
  flex-direction: row;
}

.flashes {
  list-style: none;
  padding: 10px;
}

.flashes li.success {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  margin-bottom: 5px;
  border-left: 5px solid #28a745;
}

.flashes li.error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  margin-bottom: 5px;
  border-left: 5px solid #dc3545;
}

.pankki-valinta {
    max-width: 400px;
    background-color: white;
    margin: 0 auto;
    padding: 1.5rem;
    border: 2px solid #946fc2;
    border-radius: 8px;
    text-align: center;
    display: none;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.pankki-radiot {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
  }

  .pankki-valinta label.pankki-optio {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
  }

  .pankki-valinta img {
    width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
  }

  .pankki-valinta button {
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
  }
  #pankki .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #2f3846;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
  }
  .pankki-vaihtoehto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 250px;
    padding: 5px;
    border-radius: 8px;
    margin: 5px 0;
  }

  .pankki-vaihtoehto img {
    height: 30px;
  }

  .laheta-nappi {
    margin-top: 30px;
    text-align: center;
  }

  .laheta-nappi button {
    padding: 10px 20px;
    font-size: 16px;
  }
  
  #diagrammit {
      display: flex;
      flex-direction: column;
  }

/* Footer */
.site-footer {
  width: 100%;
  margin-top: 40px;
  background: linear-gradient(135deg, #1f252f, #2f3846);
  color: #f3e9fe;
  border-top: 2px solid #946fc2;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.footer-copy {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 600;
}

.footer-links a {
  color: #c9a6f3;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

/* Privacy page */
.privacy-page {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 40px 16px 60px;
}

.privacy-card {
  width: min(1100px, 100%);
  background: linear-gradient(145deg, #1f252f, #2b3240);
  border: 1px solid #3c4454;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  padding: 32px;
  color: #f3e9fe;
}

.privacy-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.privacy-header {
  border-bottom: 1px solid rgba(148, 111, 194, 0.35);
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.privacy-meta {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #c9a6f3;
}

.privacy-lead {
  margin: 8px 0 0;
  color: #d9c8f7;
  max-width: 720px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.privacy-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 111, 194, 0.25);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.privacy-block h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
  color: #ffffff;
}

.privacy-block h3 {
  margin: 10px 0 6px;
  font-size: 15px;
  color: #c9a6f3;
}

.privacy-block p,
.privacy-block ul {
  margin: 6px 0;
  color: #e8defc;
}

.privacy-block ul {
  padding-left: 18px;
  line-height: 1.5;
}

.privacy-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 111, 194, 0.18);
  color: #ffffff;
  border: 1px solid rgba(148, 111, 194, 0.35);
}

@media (max-width: 640px) {
  .privacy-card {
    padding: 22px;
  }
}

/* Settings page */
.settings-page {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  padding: 28px 24px 50px;
  width: 100%;
  box-sizing: border-box;
}

.settings-sidebar {
  background: #1f252f;
  border: 1px solid #3c4454;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.nav-pill {
  width: 100%;
  background: #2b3240;
  color: #f3e9fe;
  border: 1px solid #3c4454;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.nav-pill:hover {
  background: #333b4d;
  transform: translateY(-1px);
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-view {
  flex-direction: column;
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(340px, 1.1fr);
  gap: 18px;
  align-items: stretch;
  width: 100%;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.charts-columns {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.settings-card {
  background: linear-gradient(145deg, #1f252f, #2b3240);
  border: 1px solid #3c4454;
  border-radius: 14px;
  padding: 18px;
  color: #f3e9fe;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  width: 100%;
  box-sizing: border-box;
}

.settings-grid > .settings-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.settings-card.full-width {
  width: 100%;
}

.settings-card.compact {
  max-width: 460px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: #c9a6f3;
}

.card-divider {
  height: 1px;
  background: rgba(148, 111, 194, 0.35);
  margin: 14px 0;
  border: none;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-row input,
.inline-row select {
  flex: 1 1 0;
  min-width: 140px;
}

.stacked-form input,
.stacked-form select,
.stacked-form button {
  width: 100%;
  max-width: 90%;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.settings-table th,
.settings-table td {
  border-bottom: 1px solid #3c4454;
  padding: 10px;
  text-align: left;
  color: #555;
}

.settings-table th {
  color: #ffffff;
  font-weight: 600;
}

.settings-table input,
.settings-table select {
  width: 100%;
  box-sizing: border-box;
  background: #f3e9fe;
  color: #1f252f;
  border: 1px solid #c9a6f3;
  border-radius: 8px;
  padding: 6px 8px;
  max-width: 100%;
}

.table-scroll {
  overflow: auto;
  max-height: 100%;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: inherit;
  height: 51px;
}

.ghost,
.danger,
.danger.ghost {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 14px;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ghost {
  background: linear-gradient(135deg, rgba(148, 111, 194, 0.4), rgba(148, 111, 194, 0.25));
  border: 1px solid #b68de4;
  color: #555;
  box-shadow: 0 8px 18px rgba(148, 111, 194, 0.25);
}

.ghost:hover {
  background: linear-gradient(135deg, rgba(148, 111, 194, 0.55), rgba(148, 111, 194, 0.35));
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(148, 111, 194, 0.32);
}

.danger {
  background: linear-gradient(135deg, #f06a64, #de524c);
  border: none;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(222, 82, 76, 0.25);
}

.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(222, 82, 76, 0.35);
}

.danger.ghost {
  border: 1px solid #f06a64;
  background: rgba(240, 106, 100, 0.12);
  color: #ffdede;
  box-shadow: none;
}

.danger.ghost:hover {
  background: rgba(240, 106, 100, 0.2);
  transform: translateY(-1px);
}

.empty-state {
  text-align: center;
  color: #cbd2e4;
}

.tapahtumalista.slim {
  padding: 0;
  background: transparent;
  border: none;
}

.tapahtumalista.slim li {
  padding: 6px 0;
  border-bottom: 1px solid #3c4454;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tapahtumalista.slim li:last-child {
  border-bottom: none;
}

.field-label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.muted {
  color: #cbd2e4;
}

@media (max-width: 1100px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .logo-container {
    margin-left: 0;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  button,
  .button,
  input[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  .settings-page {
    grid-template-columns: 1fr;
    padding: 18px 14px 40px;
  }

  .settings-sidebar {
    flex-direction: column;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card {
    padding: 14px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-row {
    flex-direction: column;
  }

  .table-scroll {
    max-height: 380px;
  }
}

@media (max-width: 900px) {
  .settings-page {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-pill {
    width: 100%;
    justify-content: center;
  }
}
