.topbar {
  display: flex;
  align-items: center;
  background: #27348b;
  color: #fff;
  padding: .8rem 20rem;
}

.email-widget {
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
}

.email-widget.has-unread {
    background-color: #ffebee;
    color: #b71c1c;
}

.email-widget.no-unread {
    background-color: #f0f0f0;
    color: #333;
}

.table td:last-child {
  min-width: 243px; /* adjust as needed */
}

.email-widget:hover {
    background-color: #e0e0e0;
}


.header-left,
.header-nav {
  flex: 0 0 auto;   /* size to content */
}

.header-logo {
  margin: 0 auto;   /* this single rule centers it */
}

.header-logo img {
  height: 40px;     /* or whatever fits your topbar */
}

.noteworthy-text {
  max-height: 60px;
  overflow: hidden;
  position: relative;
}

.noteworthy-text.expanded {
  max-height: none;
}

.toggle-notes {
  margin-top: 0.5rem;
}

/* 1. Target mobile widths */
@media (max-width: 600px) {
  .topbar {
    flex-direction: column;     /* stack items */
    align-items: center;        /* center them horizontally */
    text-align: center;         /* center text in children */
	padding:.8rem 1rem
  }

  /* 2. Reorder so logo → welcome → nav */
  .header-logo { order: 1; margin-bottom: .5rem; }
  .header-left { order: 2; margin-bottom: .5rem; }
  .header-nav  { order: 3; 
  }
    /* make nav a flex row so links stay side-by-side */
  .header-nav {
    display: flex;
    justify-content: center;    /* center the row of links */
    flex-wrap: wrap;            /* wrap onto two lines if really narrow */
  }

  /* reset any block rules you had before */
  .header-nav a,
  .header-nav .dropdown {
    display: inline-block;
    margin: 0 .5rem;            /* spacing on each side of every link/dropdown */
  }
}

:root { --bg:#f5f7fb; --card:#fff; --text:#222; --muted:#667085; --brand:#27348b; --ok:#116b36; --err:#b42318; }
*{box-sizing:border-box} body{margin:0;font-family:system-ui,Segoe UI,Arial;background:var(--bg);color:var(--text)}
.container{max-width:1000px;margin:2rem auto;padding:0 1rem}
.topbar a{color:#fff;text-decoration:none}
.card{background:var(--card);padding:1rem;border-radius:10px;box-shadow:0 1px 8px rgba(16,24,40,.06);margin-bottom:1rem}
.row{display:flex;gap:.75rem;align-items:center}
.grow{flex:1}
label{display:block;margin:.5rem 0 .25rem;color:var(--muted)}
input[type=text], input[type=email], input[type=password], textarea{width:100%;padding:.6rem;border:1px solid #d0d5dd;border-radius:8px}
button,.btn{background:var(--brand);color:#fff;border:0;padding:.5rem .9rem;border-radius:8px;cursor:pointer;text-decoration:none}
.alert{padding:.6rem .8rem;border-radius:8px;margin:.5rem 0}
.alert.ok{background:#ecfdf3;color:var(--ok);border:1px solid #abefc6}
.alert.error{background:#fee4e2;color:var(--err);border:1px solid #fecaca}
.note{border:1px solid #eee;border-radius:8px;padding:.6rem;margin:.5rem 0;background:#fff}
.note-meta{color:var(--muted);font-size:.9rem;margin-bottom:.35rem}

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

  .table thead {
    display: none;
  }

  .table tr {
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }

  .table td {
    display: block;
    position: relative;
    padding: 1.8em 12px 8px 12px; /* top padding for label */
    border: none;
    border-bottom: 1px solid #eee;
    min-height: 40px;

    /* 🔥 Override truncation styles */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  .table td::before {
    content: attr(data-label);
    display: block;
    top: 8px;
    left: 12px;
    font-weight: 600;
    font-size: 0.85em;
    color: #27348b;
    white-space: nowrap;
  }
  .table td.no-label::before {
    content: none;
  }
}





body.center { display: grid; place-items: center; height: 100vh; overflow: hidden !important; /* 🔒 Prevent scrolling */ margin: 0; }

.table th:nth-child(10),
.table td.notes-cell {
  width: 400px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
min-width: 1000px;
}

.log-table th,
.log-table td {
  padding: 8px 12px;
  border: 1px solid #ccc;
  text-align: left;
  font-size: 14px;
}

.log-table th {
  background-color: #f5f5f5;
}

input,
button,
select,
textarea {
  font-size: 16px;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  touch-action: manipulation;
}

.wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh; /* ✅ Dynamic viewport height */
  width: 100%;
}

@media (max-width: 600px) {
  .dashboard-metrics .row {
    gap: 0.5rem !important;
    margin-bottom: 0 !important;
  }

  .dashboard-metrics .card {
    margin: 0 !important;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1rem;
    box-shadow: none;
    background-color: rgba(255, 255, 255, 0.9);
  }

  .login-logo {
    max-width: 250px !important;
    margin-bottom: 0.5rem;
  }

  .subheading {
    font-size: 0.85rem;
  }
}

/* LOGIN.PHP */

.login-logo {
  display: block;
  margin: 0 auto 1rem;
  max-width: 300px;
}

.login-background {
  position: relative;
  z-index: 0;
}

.login-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../images/login-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5; /* Adjust this value as needed */
  z-index: -1;
}

/* DASHBOARD METRICS */

.dashboard-metrics .card {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex: 1 1 250px;
}
.dashboard-metrics ul {
  margin: 0;
  padding-left: 1rem;
}
.dashboard-metrics h2, h3 {
  margin-top: 0;
}

.btn.danger {
  background: #c00;
  color: #fff;
}
.btn.disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

.btn.reactivate {
  background: #2a8;
  color: #fff;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: #f0f4f8;
  border-bottom: 1px solid #ccc;
  flex-wrap: wrap;
}

.dropdown {
  display: inline-block;
  position: relative;
}

.dropbtn {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
  color: #fff;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
}

.dropdown-content a:hover {
  background-color: #eee;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.table th, .table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
  text-align: left;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table td.truncate:hover {
  white-space: normal;
  text-align: left;
  overflow: visible;
  background-color: #f9f9f9;
  position: relative;
  z-index: 1;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.filter-form select,
.filter-form input[type="date"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #f9f9f9;
  transition: border-color 0.2s ease;
}

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

.filter-form button {
  padding: 8px 16px;
  background-color: #27348b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.filter-form button:hover {
  background-color: #005fa3;
}

.filter-button {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 58px; /* Match input height + label spacing */
}

.badge {
  display: inline-block;
  padding: 0.25em 0.5em;
  font-size: 0.85em;
  font-weight: 600;
  border-radius: 0.25rem;
  color: #fff;
}
.badge-warning {
  background-color: #ad0e12;
}
.badge-secondary {
  background-color: #27348b;
}

/* Scoped to member.php only */
.note-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
}

.note-form label {
    display: flex;
    flex-direction: row;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    align-items: center;
    gap: 6px;
}

.note-form select,
.note-form input[type="date"],
.note-form input[type="text"],
.note-form textarea {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #f9f9f9;
    transition: border-color 0.2s ease;
    max-width: fit-content;
}

.note-form select:focus,
.note-form input[type="date"]:focus,
.note-form input[type="text"]:focus,
.note-form textarea:focus {
  border-color: #0077cc;
  outline: none;
  background-color: #fff;
}

.note-form textarea {
  resize: vertical;
  min-height: 80px;
}

.note-form input[type="checkbox"],
.note-form input[type="radio"] {
  margin-right: 6px;
}
.note-form label input[type="checkbox"],
.note-form label input[type="radio"] {
  vertical-align: middle;
}

.note-form .note-fields {
  padding: 12px;
  background: #f8f8f8;
  border-left: 3px solid #ccc;
  margin-bottom: 0px;
  border-radius: 4px;
}

.note-form button[type="submit"], 
.note-form button[type="button"] {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #27348b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    max-width: 100px;
}

/*
.note-form button:hover {
  background-color: #0056b3;
}
*/

.note-form .row {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  flex-wrap: wrap;
}

.info-block h2 {
  font-size: 1rem !important;
  margin-bottom: 12px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}

.deflist {
  margin: 0;
}

.deflist dt {
  font-weight: 600;
  margin-top: 8px;
  color: #333;
}

.deflist dd {
  margin-left: 0;
  margin-bottom: 8px;
  color: #555;
}

.highlight-red {
  color: #c00 !important;
  font-weight: bold;
}

.note-form .stacked-label {
  flex-direction: column;
  align-items: flex-start;
}

.card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-left: 4px solid #27348b;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  width: 100%;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  color: #27348b;
}

.card p {
  margin: 6px 0;
  font-size: 14px;
  color: #333;
}

.subheading {
  font-size: 0.95em !important;
  color: #555 !important;
  margin-bottom: 1em !important;
}

.notes-cell {
  width: 100%;
  vertical-align: top;
}

/* Reusable search‐form layout */
.form-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Let the input expand to fill the row */
.form-search .grow {
    padding: .6rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    width: 100%;
}

.note-preview {
  display: flex;
  align-items: center;
  max-width: 200px;
  cursor: default;
}

.note-text {
  display: inline-block;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expand-icon {
  margin-left: 6px;
  font-size: 0.9em;
  color: #555;
  display: none;
}

.note-preview.expanded {
  max-height: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  padding-right: 10px;
}

/* Full note overlay */
.note-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 80%;
  overflow-y: auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
  z-index: 9999;
  font-size: 14px;
  line-height: 1.5;
}

.note-overlay-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 18px;
  cursor: pointer;
  color: #333;
}

/* make the <ul> a flex row, remove bullets */
ul.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  gap: 0.5rem;
}

/* each <li> sits inline */
ul.pagination li {
  display: inline-block;
}

/* style the links as buttons */
ul.pagination a.page-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  color: #fff;
  background-color: #27348b;
  text-decoration: none;
}

.note-summary {
  background-color: #f8f9fa;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 14px;
  color: #495057;
  margin-bottom: 1rem;
}