/* ===============================================================
   GLOBAL RESET & BASE
=============================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    padding-bottom: 40px;
}

/* ===============================================================
   HEADER
=============================================================== */
.main-header {
    background: #ffffff;
    padding: 16px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 4px solid #4F8C47;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    height: 48px;
}

.header-title {
    font-size: 28px;
    font-weight: 700;
    color: #0b3c67;
}

/* ===============================================================
   CHECK-IN CARD
=============================================================== */
.section-card {
    max-width: 900px;
    width: 96%;
    margin: 40px auto;
    background: #ffffff;
    padding: 40px 50px;
    border-radius: 14px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.08);
}

/* ===============================================================
   TITLES
=============================================================== */
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #0b3c67;
    text-align: center;
    margin-bottom: 28px;
}

.section-subtitle {
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0 10px 0;
}

.section-divider {
    height: 2px;
    background: #e5e7eb;
    margin: 30px 0;
}

/* ===============================================================
   FORM FIELDS
=============================================================== */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-row label {
    font-size: 16px;
    margin-bottom: 6px;
}

.form-row input,
.form-row select {
    height: 48px;
    font-size: 16px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

/* ===============================================================
   SERVICES CHECKBOX GRID
=============================================================== */
.services-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 60px;
    margin-top: 12px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.service-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* ===============================================================
   SIGNATURE AREA (CLEAN FINAL VERSION)
=============================================================== */
.signature-pad-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    border: 2px dashed #999;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.sig-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border: none !important;
}

.sig-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: #9ca3af;
    font-size: 18px;
    opacity: 0.7;
}

/* ===============================================================
   BUTTONS
=============================================================== */
.primary-btn {
    width: 100%;
    padding: 14px;
    background: #4F8C47;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 25px;
}

.secondary-btn {
    padding: 10px 16px;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Reset Button (Red) */
#resetFormBtn {
    background: #dc2626 !important;
}
#resetFormBtn:hover {
    background: #b91c1c !important;
}

/* ===============================================================
   EXPORT BUTTONS (XLS & PDF)
=============================================================== */
.export-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 15px 0;
}

.export-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: white;
    transition: 0.2s ease-in-out;
}

.export-btn.excel {
    background: #4F8C47;
}
.export-btn.excel:hover {
    background: #3d6e37;
}

.export-btn.pdf {
    background: #1e2a38;
}
.export-btn.pdf:hover {
    background: #131b24;
}

/* ===============================================================
   ADMIN TABLE
=============================================================== */
.log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.log-table th,
.log-table td {
    border: 1px solid #ccc;
    padding: 8px;
}

.log-table th {
    background: #e6e6e6;
    font-weight: bold;
}

.sig-thumb {
    width: 90px;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* ===============================================================
   MODAL
=============================================================== */
.modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 90%;
}

.modal-box img {
    width: 100%;
    border: 1px solid #ccc;
}

/* ===============================================================
   MOBILE — original working version
=============================================================== */
@media (max-width: 600px) {
    .section-card {
        padding: 25px;
    }

    .services-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
/* Fix Date Range being pushed right */
#filterDateRange {
    margin-left: 0 !important;
}
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* allows wrapping on small screens */
}
.filter-bar input,
.filter-bar select {
    padding: 6px 10px;
    font-size: 14px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid #ccc;
}
.filter-bar select,
.filter-bar input {
    vertical-align: middle;
}
/* Make all filters equal width */
.filter-bar input,
.filter-bar select {
    min-width: 140px !important;
}
/* FIX: Make admin sidebar clickable */
.sidebar-menu {
    position: relative;
    z-index: 9999;
    pointer-events: auto !important;
}

.tab {
    cursor: pointer;
    pointer-events: auto !important;
}

/* ===============================================================
   SEARCH LOG SLIDE-OUT PANEL
=============================================================== */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.search-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 95%;
    height: 100%;
    background: #ffffff;
    box-shadow: -6px 0 18px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 1001;
    overflow-y: auto;
}

/* OPEN STATE */
.search-panel.open {
    transform: translateX(0);
}

/* HEADER */
.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.close-btn {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

/* BODY */
.search-panel-body {
    padding: 20px;
}
/* ===============================================================
   SEARCH SLIDE-OUT PANEL (ADMIN)
=============================================================== */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
}

.search-panel {
    position: fixed;
    top: 0;
    right: -420px; /* hidden off screen */
    width: 420px;
    height: 100%;
    background: #ffffff;
    z-index: 9001;
    box-shadow: -4px 0 15px rgba(0,0,0,0.25);
    transition: right 0.35s ease-in-out;
    overflow-y: auto;
}

/* PANEL OPEN STATE */
.search-panel.open {
    right: 0;
}

/* Close button */
.close-btn {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
}
/* ================================
   SEARCH LOG SLIDE PANEL (LEFT)
================================ */

#searchPanel {
  position: fixed;
  top: 0;
  left: -420px;              /* start hidden off-screen */
  width: 420px;
  height: 100vh;
  background: #ffffff;
  box-shadow: 6px 0 20px rgba(0,0,0,0.25);
  transition: left 0.35s ease;
  z-index: 1001;
  overflow-y: auto;
}

/* OPEN STATE */
#searchPanel.open {
  left: 0;
}

/* Optional polish */
#searchPanel {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}
.search-results {
    margin-top: 20px;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

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

.log-table th {
    background: #f0f4f8;
    font-weight: bold;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.report-table th,
.report-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.report-table th {
  background: #f4f6f8;
  font-weight: 600;
}
/* ===============================
   SEARCH LOG TABLE ALIGNMENT FIX
================================ */

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}

.results-table thead th {
  background: #f3f6f9;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #d0d7de;
  font-weight: 600;
  white-space: nowrap;
}

.results-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #e1e4e8;
  vertical-align: middle;
  white-space: nowrap;
}

.results-table tbody tr:hover {
  background-color: #f9fafb;
}

/* Column-specific alignment */
.results-table td:nth-child(1),
.results-table th:nth-child(1) {
  width: 110px; /* Date */
}

.results-table td:nth-child(2),
.results-table th:nth-child(2) {
  width: 110px; /* Time */
}

.results-table td:nth-child(8),
.results-table th:nth-child(8) {
  text-align: center; /* Signature */
  width: 90px;
}

/* Signature checkmark */
.results-table td:last-child {
  font-size: 16px;
  font-weight: bold;
}
.primary-btn {
  background: #4f8c47;
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.primary-btn:hover {
  background: #3f733a;
}
/* ===============================
   ADMIN DROPDOWN
================================ */

.admin-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.admin-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: #1e5e96;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.dropdown-toggle:hover {
  background: #174a76;
}

.dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-width: 220px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
}

.dropdown-menu .tab {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
}

.dropdown-menu .tab:hover {
  background: #f2f6fb;
}

/* Show dropdown */
.admin-dropdown.open .dropdown-menu {
  display: block;
}

#companySearch {
  margin-bottom: 6px;
}
.company-autocomplete {
  position: relative;
}

.company-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  margin-top: 4px;

  max-height: 220px;
  overflow-y: auto;

  display: none;
  z-index: 9999;
}

.company-suggestions div {
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
}

.company-suggestions div:hover {
  background: #f0f4ff;
}
/* ================================
   COMPANY AUTOCOMPLETE
================================ */

.company-autocomplete {
  position: relative;
}

.company-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  z-index: 9999;
  max-height: 180px;
  overflow-y: auto;
  display: none;
}

.company-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
}

.company-suggestion-item:hover {
  background: #f0f0f0;
}
/* ===============================
   DETAIL COMPANY – MATCH SEARCH LOG BUTTONS
================================ */

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.detail-actions button {
  background: #ffffff;
  color: #000000;
  border: 1px solid #bfbfbf;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: normal;
  border-radius: 2px;
  cursor: pointer;
}

/* Hover like Search Log */
.detail-actions button:hover {
  background: #f2f2f2;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

#exitAdminBtn {
  margin-left: auto;
}
.company-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  max-height: 180px;
  overflow-y: auto;
  z-index: 1000;
}

.company-suggestion {
  padding: 8px 10px;
  cursor: pointer;
}

.company-suggestion:hover {
  background: #f2f2f2;
}
.filter-bar {
  display: flex;
  align-items: center;   /* 🔥 THIS fixes the vertical misalignment */
  gap: 10px;
  flex-wrap: wrap;
}
.filter-bar label {
  margin: 0;
  line-height: 1;
}

.filter-bar input,
.filter-bar select,
.filter-bar button {
  height: 34px;           /* consistent control height */
  line-height: 34px;
}
.filter-bar .form-row {
  margin: 0;
}
.filter-bar label {
  margin-right: 4px;
}
/* ===== MULTI SELECT (SERVICES) ===== */
.multi-select {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.multi-select-display {
  border: 1px solid #ccc;
  padding: 6px 8px;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  height: 36px;
  display: flex;
  align-items: center;
}

.multi-select-options {
  display: none;
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 999;
  padding: 6px;
}

.multi-select.open .multi-select-options {
  display: block;
}

/* ===== EDIT MODAL INLINE ROW ===== */
.edit-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.edit-row .field {
  flex: 0 0 auto;
}

.edit-row .field:nth-child(1) { width: 260px; }
.edit-row .field:nth-child(2) { width: 160px; }
.edit-row .field:nth-child(3) { width: 240px; }

/* === FINAL FONT MATCH (1px BUMP) === */

/* Services closed display */
.edit-modal .multi-select-display {
  font-size: 15px !important;   /* ⬆️ from 14 → 15 */
  font-weight: 600 !important;
}

/* Services dropdown text */
.edit-modal .multi-select-options label {
  font-size: 14px !important;   /* ⬆️ from 13 → 14 */
  font-weight: 500 !important;
}

.edit-modal .multi-select-options input[type="checkbox"] {
  transform: scale(0.9);
}
/* ===============================
   FIX SERVICES LAYOUT + FONT
================================ */

/* Closed Services field (match Reason for Test) */
.edit-modal .multi-select-display {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #111827;
}

/* Dropdown container */
.edit-modal .multi-select-options {
  font-size: 13px !important;
}

/* EACH SERVICE ROW — FIXED */
.edit-modal .multi-select-options label {
  display: flex;              /* checkbox + text */
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: normal;        /* ⬅️ THIS FIXES THE PARAGRAPH ISSUE */
  padding: 4px 2px;
}

/* Checkbox size */
.edit-modal .multi-select-options input[type="checkbox"] {
  transform: scale(0.9);
}
/* === FORCE SERVICES BOX TO MATCH INPUT/SELECT HEIGHT === */

.edit-modal .multi-select-display {
  height: 38px !important;          /* MATCH input/select */
  padding: 8px 12px !important;     /* SAME inner spacing */
  border-radius: 4px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* Ensure input & select are same height too */
.edit-modal input,
.edit-modal select {
  height: 38px;
  box-sizing: border-box;
}
/* === SERVICES DISPLAY: MATCH REASON FOR TEST WEIGHT === */

.edit-modal .multi-select-display {
  font-weight: 500 !important;   /* semibold, not heavy */
  color: #111827;                /* same dark tone as selects */
}

/* Dropdown options text */
.edit-modal .multi-select-options label {
  font-weight: 500;
}
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #333;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #2ecc71;
}

.toast-error {
  background: #e74c3c;
}

.toast-warning {
  background: #f39c12;
}
/* ===============================================================
   AMS COMPLIANCE BRAND REFRESH — VISUAL ONLY
   No Worker, API, D1, R2, signature, report, or form logic changes.
=============================================================== */

:root {
  --ams-navy: #061d4e;
  --ams-navy-deep: #04163b;
  --ams-navy-soft: #0a2d69;
  --ams-green: #0c5017;
  --ams-green-hover: #083f12;
  --ams-green-soft: #eaf4ea;
  --ams-white: #ffffff;
  --ams-surface: #f4f7fa;
  --ams-surface-alt: #edf2f6;
  --ams-border: #d5dee8;
  --ams-text: #17233d;
  --ams-muted: #637083;
  --ams-danger: #b42318;
}

/* Base page */
body {
  background:
    linear-gradient(180deg, rgba(6, 29, 78, 0.05) 0, transparent 260px),
    var(--ams-surface);
  color: var(--ams-text);
  padding-bottom: 0;
}

/* Public header */
.main-header {
  min-height: 104px;
  padding: 12px clamp(18px, 4vw, 46px);
  background: var(--ams-white);
  border-bottom: 4px solid var(--ams-green);
  box-shadow: 0 3px 18px rgba(4, 22, 59, 0.10);
}

.header-left {
  gap: 18px;
  min-width: 0;
}

/*
  This uploaded logo includes the complete AMS Compliance artwork.
  Keep it wide enough to remain legible; object-fit prevents distortion.
*/
.header-logo {
  width: clamp(155px, 25vw, 255px);
  height: 78px;
  object-fit: contain;
  object-position: left center;
  flex: 0 0 auto;
}

.header-brand-copy {
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(12, 80, 23, 0.55);
}

.header-title {
  margin: 0;
  color: var(--ams-navy);
  font-size: clamp(20px, 2.3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-tagline {
  margin: 4px 0 0;
  color: var(--ams-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Check-in surface */
.section-card {
  position: relative;
  max-width: 900px;
  margin: 42px auto;
  padding: clamp(26px, 5vw, 48px);
  overflow: hidden;
  background: var(--ams-white);
  border: 1px solid var(--ams-border);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(4, 22, 59, 0.12);
}

.section-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--ams-navy) 0 42%,
    var(--ams-green) 42% 58%,
    var(--ams-navy) 58% 100%
  );
}

.section-title {
  margin-bottom: 30px;
  color: var(--ams-navy);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 800;
}

.section-subtitle {
  color: var(--ams-navy);
  font-weight: 800;
}

.section-divider {
  height: 1px;
  margin: 32px 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(12, 80, 23, 0.45),
    transparent
  );
}

/* Forms */
.form-row label {
  color: var(--ams-navy);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.form-row input,
.form-row select {
  color: var(--ams-text);
  background: var(--ams-white);
  border: 1px solid var(--ams-border);
  border-radius: 9px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--ams-green);
  box-shadow: 0 0 0 4px rgba(12, 80, 23, 0.12);
}

.form-row input::placeholder {
  color: #8a96a8;
}

/* Services */
.services-group {
  gap: 14px 48px;
}

.service-item {
  color: var(--ams-text);
  font-weight: 550;
}

.service-item input[type="checkbox"] {
  accent-color: var(--ams-green);
}

/* Signature */
.signature-pad-wrapper {
  border: 2px dashed rgba(6, 29, 78, 0.40);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(6, 29, 78, 0.025), rgba(12, 80, 23, 0.025)),
    var(--ams-white);
}

.sig-placeholder {
  color: var(--ams-muted);
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, var(--ams-green), #0a4213);
  box-shadow: 0 8px 18px rgba(12, 80, 23, 0.22);
  font-weight: 750;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn:hover {
  background: linear-gradient(135deg, var(--ams-green-hover), #06310d);
  box-shadow: 0 10px 22px rgba(12, 80, 23, 0.28);
  transform: translateY(-1px);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.dropdown-toggle:focus-visible,
.tab:focus-visible {
  outline: 3px solid rgba(12, 80, 23, 0.30);
  outline-offset: 2px;
}

.secondary-btn {
  color: var(--ams-white);
  background: var(--ams-navy);
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.secondary-btn:hover {
  background: var(--ams-navy-deep);
  transform: translateY(-1px);
}

/* Keep reset visibly distinct */
#resetFormBtn {
  background: var(--ams-danger) !important;
}

#resetFormBtn:hover {
  background: #8f1c13 !important;
}

/* Autocomplete */
.company-suggestions {
  border: 1px solid var(--ams-border);
  border-radius: 9px;
  box-shadow: 0 10px 24px rgba(4, 22, 59, 0.14);
}

.company-suggestions div:hover,
.company-suggestion:hover,
.company-suggestion-item:hover {
  background: var(--ams-green-soft);
  color: var(--ams-navy);
}

/* Admin navigation and controls */
.admin-topbar {
  margin: 22px auto 14px;
  max-width: 1180px;
  padding: 14px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
}

.dropdown-toggle {
  background: var(--ams-navy);
  border-radius: 7px;
}

.dropdown-toggle:hover {
  background: var(--ams-navy-deep);
}

.dropdown-menu {
  border-color: var(--ams-border);
}

.dropdown-menu .tab:hover {
  background: var(--ams-green-soft);
  color: var(--ams-navy);
}

/* Tables and report-facing screen elements */
.results-table,
.log-table,
.report-table {
  border-color: var(--ams-border);
  background: var(--ams-white);
}

.results-table thead th,
.log-table th,
.report-table th {
  color: var(--ams-white);
  background: var(--ams-navy);
  border-color: rgba(255, 255, 255, 0.18);
}

.results-table tbody td,
.log-table td,
.report-table td {
  border-color: var(--ams-border);
}

.results-table tbody tr:hover {
  background: var(--ams-green-soft);
}

/* Modals */
.modal-box {
  border: 1px solid var(--ams-border);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.25);
}

.modal-box h3 {
  color: var(--ams-navy);
}

/* Provider credit */
.platform-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: center;
  min-height: 74px;
  margin-top: 16px;
  padding: 20px 24px;
  color: rgba(255, 255, 255, 0.86);
  background: linear-gradient(100deg, var(--ams-navy-deep), var(--ams-navy));
  border-top: 4px solid var(--ams-green);
  text-align: center;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.035em;
}

/* Responsive header */
@media (max-width: 680px) {
  .main-header {
    min-height: auto;
    padding: 14px 18px;
  }

  .header-left {
    width: 100%;
    gap: 12px;
  }

  .header-logo {
    width: 146px;
    height: 66px;
  }

  .header-brand-copy {
    padding-left: 12px;
  }

  .header-title {
    font-size: 19px;
  }

  .header-tagline {
    font-size: 10px;
    line-height: 1.35;
  }

  .section-card {
    width: calc(100% - 28px);
    margin: 24px auto;
    border-radius: 13px;
  }
}

@media (max-width: 430px) {
  .header-brand-copy {
    display: none;
  }

  .header-logo {
    width: min(255px, 78vw);
    height: 76px;
  }

  .services-group {
    gap: 12px;
  }
}

/* ===============================================================
   ADMIN CONTROLS ONLY
   Keep tables, donor form, footer, and application logic unchanged.
=============================================================== */
#adminArea :is(
  .admin-nav > .tab,
  .admin-nav .dropdown-toggle,
  #tabSearch .export-bar > button,
  #tabSearch .search-actions > button,
  #tabCompany .export-right > button,
  #tabCompany .detail-actions > button
) {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--ams-navy);
  border-radius: 7px;
  background: var(--ams-navy);
  color: var(--ams-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

#adminArea :is(
  .admin-nav > .tab,
  .admin-nav .dropdown-toggle,
  #tabSearch .export-bar > button,
  #tabSearch .search-actions > button,
  #tabCompany .export-right > button,
  #tabCompany .detail-actions > button
):hover {
  background: var(--ams-navy-deep);
  border-color: var(--ams-navy-deep);
}

#adminArea :is(
  .admin-nav > .tab,
  .admin-nav .dropdown-toggle,
  #tabSearch .export-bar > button,
  #tabSearch .search-actions > button,
  #tabCompany .export-right > button,
  #tabCompany .detail-actions > button
):focus-visible {
  outline: 3px solid rgba(12, 80, 23, 0.45);
  outline-offset: 2px;
}

#adminArea .admin-topbar,
#adminArea .admin-nav {
  flex-wrap: wrap;
  gap: 10px;
}

/* Shorter filter fields, not narrower result tables. */
#tabSearch .search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 16px;
}

#tabSearch .search-form > .form-row {
  flex: 0 1 180px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

#tabSearch .search-form > .form-row:nth-child(3) {
  flex-basis: 280px;
}

#tabSearch .search-form input,
#tabSearch .search-form select,
#tabCompany .filter-bar input,
#tabCompany .filter-bar select {
  height: 38px;
  min-width: 0 !important;
  padding: 8px 12px;
  border: 1px solid var(--ams-border);
  border-radius: 7px;
  background: var(--ams-white);
  color: var(--ams-text);
  font-family: inherit;
  font-size: 14px;
  line-height: normal;
}

#tabSearch .search-form input,
#tabSearch .search-form select {
  width: 100%;
}

#tabCompany .filter-bar > .form-row {
  max-width: 100%;
}

#detailCompanyInput {
  width: 280px;
  max-width: 100%;
}

#detailDateRange {
  width: 180px;
  max-width: 100%;
}

#tabCompany .filter-bar input:focus,
#tabCompany .filter-bar select:focus {
  outline: none;
  border-color: var(--ams-green);
  box-shadow: 0 0 0 4px rgba(12, 80, 23, 0.12);
}

#tabSearch .search-actions,
#tabSearch .export-bar,
#tabCompany .export-right,
#tabCompany .detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 600px) {
  #tabSearch .search-form > .form-row {
    flex-basis: calc(50% - 8px);
  }

  #tabSearch .search-form > .form-row:nth-child(3) {
    flex-basis: 100%;
  }

  #tabSearch .search-actions {
    flex-basis: 100%;
  }

  #tabCompany .filter-bar > label,
  #tabCompany #detailCustomDates {
    margin-left: 0 !important;
  }

  #tabCompany #detailCustomDates input {
    width: 145px;
    max-width: 100%;
  }
}
