/* ------------------------------------------------------
   GLOBAL RESET + BASE
------------------------------------------------------- */

@import "styleguide.css";

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  font-family: var(--font-family);
  background-color: rgb(250, 250, 250);
  color: var(--primary-text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------
   LAYOUT
------------------------------------------------------- */

main {
  --margins: 30px;
  --sidebar-width: 480px;
  display: flex;
  align-items: flex-start;
  flex: 1;
  margin-bottom: 2rem;
  flex-wrap: wrap; /* allow wrapping on small screens */
}

.content {
  max-width: 1600px;
  width: 100%;
  padding: 0 1rem; /* ensures padding on mobile */
  margin: 96px auto 0;
  gap: 1rem;
  display: flex;
  flex-wrap: wrap; /* children wrap on small screens */
  min-height: 78vh;
}

/* SIDEBAR + MAIN SECTION (Desktop layout) */
aside {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  position: sticky;
  top: 96px;
  padding: 2rem;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
}

section {
  flex: 1; /* take remaining space */
  min-width: 0;
  margin-bottom: 1rem;
  margin-top: 0px;
}

aside,
section {
  padding: 2rem;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 7%) !important;
  border-radius: 8px;
}

footer {
  text-align: center;
  align-items: center;
  margin-bottom: 1rem;
}

/* ------------------------------------------------------
   NAVBAR
------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.navbar-container {
  background: white;
  height: 80px;
  padding: 1rem 2rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 7%) !important;
  width: 100%;
  padding-inline: 2rem;
}

.navbar-logo img {
  height: 42px;
  width: auto;
  display: block;
}

.navbar-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.navbar-links a {
  text-decoration: none;
  color: var(--primary-text);
  font-weight: 700;
  transition: color 0.2s;
}

.navbar-links a:hover {
  color: #006e5e;
}

/* Hidden by default; appears at 720px */
.navbar-burger {
  display: none;
  cursor: pointer;
  font-size: 32px;
  user-select: none;
}

/* ------------------------------------------------------
   TYPOGRAPHY
------------------------------------------------------- */

h1 {
  color: inherit;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 2rem;
}
h2 {
  color: inherit;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
}
h3 {
  color: inherit;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 500;
}
footer a {
  text-decoration: none;
  color: rgb(25, 41, 159);
  font-weight: 500;
}

a {
  text-decoration: underline;
  color: rgb(25, 41, 159);
  font-weight: 500;
}

/* ------------------------------------------------------
   FORMS
------------------------------------------------------- */

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

label input {
  margin-top: 0.5rem;
}

form {
  width: 100%;
}
form p {
  margin-top: 0;
  margin-bottom: 1rem;
}
form .btn-group {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  gap: 1rem;
}

.form-group > * {
  flex: 1; /* each child takes equal full width */
}

input[type="date"],
input[type="time"],
input[type="number"],
input[list] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-family);
}

input[type="checkbox"] {
  cursor: pointer;
  scale: 1.1;
}

button {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font: var(--font-family);
  font-weight: 600;
  background-color: transparent;
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
  cursor: pointer;
}

.primary-btn {
  background-color: var(--primary-green);
  color: white;
}

.primary-btn:hover {
  background-color: rgba(0, 102, 79, 0.9);
}

.secondary-btn:hover {
  background-color: rgba(0, 102, 79, 0.1);
}

.rm-btn {
  padding: 6px 8px;
}

/* ------------------------------------------------------
   TABLES
------------------------------------------------------- */

.table-wrapper {
  width: 100%;
  overflow-x: auto; /* enables horizontal scrolling if table is wider */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
  padding-bottom: 0.5rem; /* extra space so the scroll doesn’t get cut off */
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  word-wrap: break-word;
}

table th:first-child,
table td:first-child {
  width: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th,
td {
  padding: 0.25rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid #ccc;
}

tfoot td {
  padding: 0.5rem 0.5rem;
  border-bottom: 3px double var(--primary-text);
}

.title-w-btns {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.title-w-btns h1 {
  margin-bottom: 0;
  margin-top: 0;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

/* ------------------------------------------------------
   BREAKPOINT 1 — 1140px (stack layout)
------------------------------------------------------- */

@media (max-width: 1140px) {
  .content {
    flex-direction: column;
  }

  aside {
    width: 100%;
    flex: none;
    position: static;
  }
}

/* ------------------------------------------------------
   BREAKPOINT 2 — 720px (burger menu)
------------------------------------------------------- */

@media (max-width: 720px) {
  aside,
  section {
    padding: 1rem;
  }

  .content {
    padding: 0;
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 74px;
    width: 100%;
    flex-direction: column;
    gap: 2rem;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    padding: 1rem;
    z-index: 100;
    transition: max-height 0.3s ease;
    max-height: 0;
    overflow: hidden;
  }

  .navbar-links.show {
    display: flex;
    max-height: 500px;
    right: 0rem;
  }

  .navbar-burger {
    display: block;
  }

  .navbar-links a,
  .navbar-links button {
    width: 100%;
    text-align: center;
  }

  .navbar-logo img {
    height: 32px;
    width: auto;
    display: block;
  }

  button {
    min-height: 52px;
    min-width: 120px;
  }

  .title-w-btns {
    flex-direction: column;
    align-items: flex-start; /* align left when stacked */
  }

  .btn-group {
    flex-direction: column;
    width: 100%; /* buttons fill container on mobile */
  }

  .form-group {
    flex-direction: column;
    gap: 0rem;
  }
}

/* ------------------------------------------------------
   PRINT STYLES
------------------------------------------------------- */

@media print {
  @page {
    margin: 36px;
  }
  body {
    font-size: 12px;
  }
  body * {
    visibility: hidden;
  }
  h1,
  h2 {
    font-size: 14px;
  }

  .printable-table,
  .printable-table * {
    visibility: visible;
  }
  .printable-table {
    position: absolute;

    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    page-break-inside: avoid;
  }

  .rm-from-print {
    display: none !important;
  }
}
