/* ===============================
   🧱 Grundlayout & typografi
================================= */
body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  font-size: 20px;
  line-height: 1.5;
  background-color: #f8f9fa;
}

.wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  font-size: 48px;
  margin: 20px 0;
}

/* ===============================
   🔍 Sökfält & toppknappar
================================= */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.search-input {
  flex: 1 1 250px;
  max-width: 300px;
  padding: 10px;
  font-size: 20px;
}

.btn {
  padding: 10px 14px;
  font-size: 16px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #0056b3;
}

/* ===============================
   📋 Tabell & färgkodning
================================= */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

th, td {
  padding: 1px;
  font-size: 28px;
  text-align: left;
  border-bottom: 1px solid #ccc;
}

th {
  background-color: #e9ecef;
  cursor: pointer;
}

.row-expired {
  background-color: #f8d7da;
}

.row-warning {
  background-color: #fff3cd;
}

.row-ok {
  background-color: #d4edda;
}

/* ===============================
   🧾 Formulär
================================= */
.main-form {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 20px;
  margin-top: 20px;
}

.form-input {
  width: 100%;
  padding: 10px;
  font-size: 18px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.form-label {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 10px;
  color: #28a745;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===============================
   🧮 Knappar: Lägg till, Edit, Delete
================================= */
#showBtn,
.edit-btn {
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 18px;
  cursor: pointer;
  margin: 20px auto;
  display: block;
  transition: background-color 0.3s ease;
}

.edit-btn:hover,
#showBtn:hover {
  background-color: #218838;
}

.edit_btn {
  background-color: #007BFF;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  margin-right: 6px;
  display: inline-block;
}

.del_btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 16px;
  color: #dc3545;
  cursor: pointer;
  line-height: 1;
  display: inline;
}

.del_btn:hover {
  color: #a71d2a;
}

/* ===============================
   🧭 Färglegend
================================= */
.legend {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 20px;
  margin-top: 30px;
  font-size: 16px;
}

.legend ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legend li {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ===============================
   📱 Mobilanpassning
================================= */
@media (max-width: 600px) {
  .wrapper {
    padding: 10px;
  }

  .top-bar,
  .column-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input,
  .btn {
    width: 100%;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 15px;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: white;
  }

  td {
    position: relative;
    padding-left: 50%;
    font-size: 16px;
    border: none;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    top: 10px;
    font-weight: bold;
    color: #333;
  }
}
