/* Reset defaults for consistency */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

/* General layout */
body {
  background: #f7f7f7;
  color: #222;
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

button {
  width: 100%;
  background: #007bff;
  color: white;
  border: none;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 0.2rem;
}

/* Navigation bar */
nav {
  display: flex;
  flex-wrap: wrap;          /* allows wrapping on small screens */
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

/* Navigation links */
nav a {
  color: white;
  background: #007bff;      /* blue background */
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  transition: all 0.2s ease-in-out;
  display: inline-block;
}

nav a:hover {
  background: #0056b3;      /* darker blue on hover */
}


/* Header */
h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #333;
}


/* Forms */
form {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

form label {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.2rem;
}

form input,
form select {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

form button {
  width: 100%;
  background: #007bff;
  color: white;
  border: none;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 0.2rem;
}

form button:hover {
  background: #0069d9;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

thead {
  background: #007bff;
  color: white;
}

th, td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f1f9ff;
}

/* Buttons inside table */
table button {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

table button:hover {
  background: rgba(0, 123, 255, 0.1);
}


table input,
table select {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fafafa;
  color: #222;
  transition: border-color 0.2s, background 0.2s;
}

table input:focus,
table select:focus {
  outline: none;
  border-color: #007bff;
  background: #fff;
}

table input[type="number"] {
  text-align: right;
}

/* Make inline inputs fit well inside table cells */
td input,
td select {
  margin: 0;
  display: block;
  box-sizing: border-box;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    background: #fff;
    margin-bottom: 1.3rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    padding: 0.6rem;
  }

  td {
    border: none;
    display: flex;
    justify-content: start;
    padding: 0.2rem 0;
    white-space-collapse:preserve;
    align-items: center;
  }

  td.tdId {
    border-bottom: 1px solid #555 !important;
    justify-content: center;
  }

  td::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: #555;
    margin-right: 0.2rem;
  }

  table button {
    width: auto;
    font-size: 0.85rem;
  }

    table input,
  table select {
    font-size: 0.85rem;
    padding: 0.3rem;
    margin-left: 0.3rem;
  }

  td button {
    width: 100%;
    margin-top: 0.3rem;
  }
}

      /* Filter bar styling */
      .filter-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding: 1rem;
        justify-content: center;
      }

      .filter-bar input,
      .filter-bar select,
      .filter-bar button {
        padding: 0.5rem;
        border: 1px solid #007BFF;
        border-radius: 6px;
        font-size: 1rem;
        flex-grow: 1;
      }

      .flex {
        display: flex;
        gap: 0.5rem;
      }
