body {
  font-family: Arial, sans-serif;
  padding: 30px;
  background: #f4f4f4;
}

h1, h2 {
  color: #c00;
  margin-bottom: 20px;
}

.msg {
  margin: 15px 0;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: opacity 0.5s ease;
}

.success {
  background: #d4edda;
  color: #155724;
}

.error {
  background: #f8d7da;
  color: #721c24;
}

.warning {
  background: #fff3cd;
  color: #856404;
}

.upgrade { margin: 10px 0; font-size: 16px; }

.site-header {
  background-color: #333;
  border-bottom: 1px solid #ccc;
  padding: 10px 10px;
  border-radius: 0 0 8px 8px;
  margin-bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo-link {
  flex-shrink: 0;
}

.logo {
  height: 150px;
  width: auto;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  th {
    background-color: #666;
    color: #fff;
  }

.nav-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.nav-links > a,
details summary {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background 0.3s;
  cursor: pointer;
  box-sizing: border-box;
  min-width: 120px;
  text-align: center;
}

.nav-links > a:hover,
details summary:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.nav-links a.active {
  background-color: rgba(255, 255, 255, 0.4);
  border-bottom: 3px solid #fff;
}
details {
  position: relative;
}

details summary {
  list-style: none;
  cursor: pointer;
}

details[open] summary::after {
  content: "▲";
  float: right;
  font-size: 12px;
}

details summary::after {
  content: "▼";
  float: right;
  font-size: 12px;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(0, 0, 0, 0.85);
  border-radius: 4px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  z-index: 10;
}

.submenu a {
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu a:hover {
  background-color: rgba(255, 255, 255, 0.25);
}
.hamburger {
  display: none;
}
@media (max-width: 858px) {
    html{
        width: 100%;
    }
    body {
        padding: env(safe-area-inset-top) 8px env(safe-area-inset-bottom) 8px;
    }

  h1, h2 {
    font-size: 1.4rem;
  }

  form label {
    display: block;
    margin-top: 20px;
    font-weight: bold;
    font-size: 1rem;
  }

  form select,
  form input {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 1.6rem;
  }

  .site-header,
  .header-top {
    background-color: #333 !important;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
    height: auto;
  }

  .header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    height: 100px;
    margin-bottom: 10px;
  }

  .hamburger {
    font-size: 42px;
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    display: block;
    line-height: 1;
    z-index: 1005;
    align-self: center;
  }

  .mobile-hidden {
    display: none !important;
  }

  .nav-wrapper,
  #mobileMenu {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.85) !important;
    border-radius: 6px;
    padding: 6px;
    margin-top: 10px;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .nav-links > a,
  details summary {
    width: 100%;
    text-align: left;
    font-size: 1rem;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
  }

  .submenu {
    position: static;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 0;
    width: 100%;
  }

  .submenu a {
    font-size: 1rem;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: left;
    background-color: transparent;
  }

  .summary {
    display: flex;
    gap: 2px;
    margin-top: 10px;
    flex-wrap: wrap;
    font-size: 1em;
  }

  .box {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
  }

  .box h2 {
    margin: 0;
    font-size: 1em;
    color: #666;
  }

  .box p {
    margin-top: 10px;
    color: #777;
    font-weight: bold;
    font-size: 1em;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 1em;
  }

  th,
  td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    font-size: 1em;
  }

  th {
    background-color: #666;
    color: #fff;
  }

  tr:hover {
    background-color: #f9f9f9;
  }

  .class-capacity {
    font-size: 1.2em;
    background: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    color: #666;
  }

  .filter-group label {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    font-size: 1em;
  }

  .filter-form select {
    font-size: 1em;
  }

  .filter-form input[type="date"],
  .filter-form select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
  }

  .filter-form input[type="date"]:focus,
  .filter-form select:focus {
    border-color: #333;
    outline: none;
  }

  .filter-form button[type="submit"],
  .clear-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1em;
  }

  .filter-form button[type="submit"] {
    background: #333;
    color: #fff;
    border: none;
    font-size: 1em;
  }

  .filter-form button[type="submit"]:hover {
    background: #900;
  }

  .clear-btn {
    background: #eee;
    color: #333;
    text-decoration: none;
  }

  .clear-btn:hover {
    background: #ddd;
  }

  .action-btn {
    font-size: 1em;
  }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table-scroll table {
  min-width: 700px; /* adjust based on column count */
  width: 100%;
}

    .form-wrapper .class-list label.class-item {
        display: flex !important;
        align-items: flex-start !important;
        padding: 10px 0 !important;
        font-size: 0.95em !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .form-wrapper .class-list label.class-item input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        margin: 0 6px 0 0 !important;
        flex-shrink: 0 !important;
        -webkit-flex-shrink: 0 !important;
    }
    .form-wrapper .class-list label.class-item .class-info {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 1em !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        display: -webkit-box !important;
    }
    .form-wrapper .class-list label.class-item .class-info .status {
        display: block !important;
        margin: 4px 0 0 0 !important;
        font-size: 0.85em !important;
    }
}



@media (max-device-width: 390px) {
    .form-wrapper .class-list label.class-item {
        display: flex !important;
        align-items: flex-start !important;
        padding: 10px 0 !important;
        font-size: 0.95em !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .form-wrapper .class-list label.class-item input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        margin: 0 6px 0 0 !important;
        flex-shrink: 0 !important;
        -webkit-flex-shrink: 0 !important;
    }
    .form-wrapper .class-list label.class-item .class-info {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 1em !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
        display: -webkit-box !important;
    }
    .form-wrapper .class-list label.class-item .class-info .status {
        display: block !important;
        margin: 4px 0 0 0 !important;
        font-size: 0.85em !important;
    }
}