body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: #0b1320;
  color: #f3f6fa;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background-color: #f3f6fa;
  color: #0b1320;
  width: 100%;
  max-width: 960px;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

@media (min-width: 768px) {
  .container {
    grid-template-columns: 1fr 1fr;
  }
}
.left-panel {
  background-color: #0b1320;
  color: white;
  padding: 3rem 2rem;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .left-panel {
    display: flex;
  }
}

.logo-wrapper {
  background-color: #f3f6fa;
  padding: 1rem;
  border-radius: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  max-width: 140px;
  height: auto;
}

.welcome-text {
  max-width: 300px;
}

.welcome-text h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: white;
}

.welcome-text p {
  font-size: 1rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.right-panel {
  padding: 2.5rem 2rem;
  background-color: #f3f6fa;
}

.tab-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.tab-buttons button {
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #64748b;
  transition: all 0.3s ease;
}

.tab-buttons button.active {
  border-color: #1c3f60;
  color: #0b1320;
}

.form {
  display: none;
}

.form.active {
  display: block;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: white;
  color: #0b1320;
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #1c3f60;
  box-shadow: 0 0 0 3px rgba(28, 63, 96, 0.3);
}

button.submit {
  width: 100%;
  background-color: #1c3f60;
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s;
}

button.submit:hover {
  background-color: #174d80;
  transform: translateY(-2px);
}

.error-message {
  color: #e43f5a;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.show {
  display: block;
}

.dashboard-container {
  max-width: 1000px;
  width: 90%;
  margin: 2rem auto;
  background-color: #0b1320;
  color: #f3f6fa;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
}

.dashboard-container h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.dashboard-container .welcome {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.dashboard-container button,
.dashboard-container .cancel-btn {
  background-color: #1c3f60;
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background-color 0.3s ease;
}

.dashboard-container button:hover,
.dashboard-container .cancel-btn:hover {
  background-color: #174d80;
}

/* Adjust the logout button */
form[action="/logout"] button {
  background-color: #e43f5a;
  margin-top: 2rem;
}
form[action="/logout"] button:hover {
  background-color: #c12d48;
}

/* Table styles */
.company-table {
  width: 100%;
  margin-top: 1.5rem;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
}

.company-table th,
.company-table td {
  padding: 1rem;
  text-align: left;
  background-color: #0e1a31;
  border-bottom: 1px solid #1f2d47;
}

.company-table th {
  background-color: #1c3f60;
  color: #f3f6fa;
}

.company-table td a {
  color: #8ab4f8;
  text-decoration: none;
  font-weight: 500;
}

.company-table td a:hover {
  text-decoration: underline;
}

/* Search box */
.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 1rem;
}

/* Modal form tweaks */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-form {
  background: #fff;
  color: #0b1320;
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Updated Modal Styling to Match Login Theme */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(11, 19, 32, 0.75); /* match dark theme */
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-form {
  background-color: #f3f6fa;
  color: #0b1320;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s ease;
}

.popup-form h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-align: left;
}

.popup-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1c3f60;
}

.popup-form input {
  width: 100%;
  padding: 0.7rem 1rem;
  margin-bottom: 1.2rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
  background-color: white;
  color: #0b1320;
}

.popup-form input:focus {
  outline: none;
  border-color: #1c3f60;
  box-shadow: 0 0 0 3px rgba(28, 63, 96, 0.25);
}

.popup-form .save-btn,
.popup-form .cancel-btn {
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.popup-form .save-btn {
  background-color: #1c3f60;
  color: white;
  margin-right: 1rem;
}

.popup-form .save-btn:hover {
  background-color: #174d80;
}

.popup-form .cancel-btn {
  background-color: #e0e0e0;
  color: #0b1320;
}

.popup-form .cancel-btn:hover {
  background-color: #ccc;
}

/* Optional animation for smoother appearance */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Company Profile Styling ===== */

.company-profile-container {
  max-width: 1000px;
  margin: 2rem auto;
  background-color: #f3f6fa;
  color: #0b1320;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.company-profile-container h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #d0d7e2;
}

.section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section h4 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.data-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.data-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #e0e7ef;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.95rem;
}

.data-table thead {
  background-color: #1c3f60;
  color: #f3f6fa;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  background-color: #ffffff;
  border-bottom: 1px solid #dbe4ee;
}

.data-table tbody tr:nth-child(even) td {
  background-color: #f8fbfd;
}

/* File upload */
input[type="file"] {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* General button style */
button {
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background-color: #1c3f60;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  margin: 0.3rem 0.3rem 0.3rem 0;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #174d80;
}

/* Special action buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.action-buttons button {
  flex: 1 0 auto;
}

/* Success & Error Messages */
p[style*="color: red"] {
  color: #e43f5a !important;
  font-weight: 500;
}

p[style*="color: green"] {
  color: #28a745 !important;
  font-weight: 500;
}

/* Link Back */
.company-profile-container a {
  color: #1c3f60;
  text-decoration: none;
  font-weight: 500;
}

.company-profile-container a:hover {
  text-decoration: underline;
}

.feedback-banner {
  padding: 1rem;
  margin: 1rem auto;
  max-width: 400px;
  text-align: center;
  border-radius: 6px;
  transition: opacity 0.5s ease;
  font-weight: 500;
}

.feedback-banner.error {
  background-color: #e43f5a;
  color: white;
}

.feedback-banner.success {
  background-color: #38a169; /* green */
  color: white;
}

form input {
  margin-bottom: 1rem;
  padding: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.status-active {
  color: green;
  font-weight: bold;
}

.status-offline {
  color: red;
  font-weight: bold;
}

.status-inactive {
  color: orange;
  font-weight: bold;
}

.status-na {
  color: #888;
  font-weight: bold;
}

/* Fullscreen modal backdrop */
.modal {
  position: relative; /* no longer fixed to screen */
  margin: 80px auto; /* push down below nav bar */
  /* top: auto; reset top */
  left: auto; /* reset left */
  transform: none; /* no forced centering */
  /* scroll-margin-top: 200px; same as your nav height */
  display: none;
  /* position: fixed; */
  z-index: 9999; /* ensure it's on top */
  /* left: 0; */
  /* top: 0; */
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5); /* semi-transparent dark background */
}

/* Centered white box */
.modal-content {
  backdrop-filter: blur(2px);

  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background-color: #fff;
  padding: 2rem;
  border-radius: 1rem;
  width: 90%;
  min-width: 80vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: all 0.3s ease;
  min-height: 45rem;
  scroll-margin-top: 4rem;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
}

.tank-row {
  cursor: pointer;
}
.tank-row:hover {
  border: solid 1px #0b1320 !important;
  border-radius: 1.2rem;
  font-weight: bold;
}
.modal-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* allows more control */
  gap: 1.5rem;
  margin-top: 2rem;

  max-height: 80vh; /* keep it inside the viewport */
  overflow-y: auto; /* scroll if content too tall */
  padding: 1rem; /* so scroll bar doesn’t crush content */
}

/* Base box */
.modal-box {
  background-color: rgba(243, 246, 250, 0.96); /* your dashboard theme light */
  color: #0b1320; /* your dark text */
  border-radius: 1rem;
  padding: 1.5rem;
  min-height: 20rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Box 1: Tank info */
.modal-box.info {
  grid-column: span 1;
}

/* Box 2: Tank tile latest */
.modal-box.tile {
  grid-column: span 1;
}

/* Box 3: History graph — double width */
.modal-box.graph {
  grid-column: span 2;
}

/* Full-width shared-with box */
.modal-box.full {
  grid-column: span 4;
}

/* Optional: nice headers */
.modal-box h4 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.modal-box.tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* header stays at top */
  /* so child can center vertically */
}

.modal-box.tile h4 {
  margin-bottom: 1rem;
}

.tank-tile {
  background-color: #8e8e8e7e;
  border-radius: 1.5rem;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.shared-with-section {
  margin-top: 1rem;
}

.share-tank-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

/* === Share Sheet (drawer) === */
.sharesheet-backdrop {
  position: absolute; /* stays inside the modal-content bounds */
  inset: 0;
  background: rgba(11, 19, 32, 0.35);
  backdrop-filter: blur(1px);
  z-index: 10;
}

.sharesheet-panel {
  position: absolute; /* anchored to the right inside modal-content */
  top: 0;
  right: 0;
  height: 100%;
  width: min(480px, 95%);
  background: #f3f6fa;
  color: #0b1320;
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.25);
  border-left: 1px solid #d0d7e2;
  z-index: 11;

  display: flex;
  flex-direction: column;

  /* hidden by default, animate in */
  transform: translateX(100%);
  opacity: 0;
  transition: transform 220ms ease, opacity 200ms ease;
  border-top-right-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

.sharesheet-panel.open {
  transform: translateX(0);
  opacity: 1;
}

.sharesheet-header,
.sharesheet-footer {
  padding: 1rem 1.25rem;
  background: #eaf1f7;
  border-bottom: 1px solid #d0d7e2;
}

.sharesheet-footer {
  border-top: 1px solid #d0d7e2;
  border-bottom: none;
  margin-top: auto;
}

.sharesheet-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
}

.sharesheet-header h3 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sharesheet-close {
  margin-left: auto;
  background: transparent;
  color: #0b1320;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
}
.sharesheet-close:hover {
  background: rgba(11, 19, 32, 0.08);
}

.share-form .share-section h4 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c3f60;
}

.share-form label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
  color: #0b1320;
}

.share-form input[type="email"],
.share-form input[type="number"],
.share-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #0b1320;
  font-size: 0.95rem;
}

.share-form input:focus,
.share-form textarea:focus {
  outline: none;
  border-color: #1c3f60;
  box-shadow: 0 0 0 3px rgba(28, 63, 96, 0.25);
}

.alert-fieldset {
  border: 1px solid #d0d7e2;
  border-radius: 0.6rem;
  padding: 0.75rem 0.9rem 1rem;
  background: #ffffff;
}

.alert-fieldset legend {
  padding: 0 0.4rem;
  font-weight: 700;
  color: #0b1320;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: end;
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* —— Share Sheet layout polish —— */
.sharesheet-body {
  padding: 1.25rem;
}
.share-form {
  display: grid;
  gap: 1rem; /* global breathing room between sections */
}

/* Sections */
.share-form .share-section {
  background: #ffffff;
  border: 1px solid #d0d7e2;
  border-radius: 0.75rem;
  padding: 1rem;
}

/* Headings */
.share-form .share-section h4 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1c3f60;
}

/* Inputs */
.share-form label {
  display: block;
  margin: 0.35rem 0 0.25rem;
  font-weight: 600;
  color: #0b1320;
}
.share-form input[type="email"],
.share-form input[type="number"],
.share-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #0b1320;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.share-form textarea {
  resize: vertical;
}
.share-form input:focus,
.share-form textarea:focus {
  outline: none;
  border-color: #1c3f60;
  box-shadow: 0 0 0 3px rgba(28, 63, 96, 0.18);
}

/* Help text and small notes */
.share-form small {
  display: block;
  opacity: 0.75;
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* Divider */
.share-form hr {
  border: none;
  border-top: 1px solid #d0d7e2;
  margin: 0.25rem 0 0; /* keep it tight; sections already have spacing */
}

/* Alert fieldsets */
.alert-fieldset {
  position: relative;
  margin: 0;
  padding: 1rem;
  border: 1px solid #d0d7e2;
  border-radius: 0.6rem;
  background: #ffffff;
}
.alert-fieldset legend {
  font-weight: 700;
  color: #0b1320;
  font-size: 0.95rem;
  padding: 0 0.5rem;
  margin-left: 0.5rem;
  background: #f3f6fa; /* matches sheet background so it “cuts” the border cleanly */
  border-radius: 0.35rem;
  line-height: 1.2;
}
.alert-fieldset > *:not(legend) {
  /* consistent spacing inside */
  margin-top: 0.5rem;
}

/* Threshold row (keeps label and input aligned nicely) */
.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 220px 1fr; /* label column + input column */
    align-items: center;
  }
  .field-row label {
    margin: 0; /* label sits inline next to input */
  }
}

/* Actions */
.sharesheet-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
.sharesheet-actions .save-btn,
.sharesheet-actions .cancel-btn {
  padding: 0.7rem 1.1rem;
  border-radius: 0.5rem;
  font-weight: 700;
}

/* Prevent scrollbars from clipping rounded corners on the sheet */
.sharesheet-panel {
  overflow: hidden;
}
.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0.6rem; /* space between input and badge */
  width: 100%;
}

.input-with-unit input {
  flex: 1 1 auto; /* grow to take available width */
  min-width: 10rem; /* prevents overflow */
  padding-right: 0.75rem;
}

.unit-badge {
  flex: 0 0 auto; /* badge stays fixed size */
  padding: 0.35rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fbfd;
  color: #0b1320;
  font-size: 0.85rem;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

/* On very narrow screens, let the badge wrap below neatly */
@media (max-width: 420px) {
  .input-with-unit {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .unit-badge {
    order: 2;
  }
}

/* Wider right-side drawer: ~50% of the modal */
.sharesheet-panel {
  /* was: width: min(480px, 95%); */
  width: clamp(420px, 50%, 860px); /* min 420px, prefer 50%, cap 860px */
}

/* Let content scroll vertically inside, not sideways */
.sharesheet-panel {
  overflow: hidden;
}
.sharesheet-body {
  padding: 1.25rem;
  overflow-y: auto;
  overflow-x: hidden; /* no horizontal scroll */
  /* remove any min-width you added earlier */
}

/* Keep it usable on small screens: go full width under ~720px */
@media (max-width: 720px) {
  .sharesheet-panel {
    width: 96%;
  }
}
/* === Toggle switch inside Alerts === */

/* Container */
.alert-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem; /* space between switch and text */
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

/* Hide the real checkbox, keep it accessible */
.alert-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Switch styling */
.alert-toggle .switch {
  width: 36px;
  height: 20px;
  flex: 0 0 36px; /* fixed size */
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Knob inside the switch */
.alert-toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

/* Checked state */
.alert-toggle input:checked + .switch {
  background: #1c3f60;
}
.alert-toggle input:checked + .switch::after {
  transform: translateX(16px);
}

/* Label text */
.alert-toggle .label {
  font-size: 0.9rem;
  color: #0b1320;
  line-height: 1.2;
  white-space: nowrap; /* prevents wrapping under the switch */
}

/* Disabled state for the whole alert block */
.alert-fieldset.is-inactive {
  opacity: 0.6;
}
.alert-fieldset.is-inactive input,
.alert-fieldset.is-inactive textarea {
  background: #f0f3f7;
  cursor: not-allowed;
}

/* ---- FIX: make the toggle label a flex row, beat the generic .share-form label ---- */
.share-form label.alert-toggle {
  display: inline-flex !important; /* out-prioritize .share-form label { display:block } */
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

/* keep the input visually hidden but clickable via the label */
.share-form label.alert-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* the switch */
.share-form label.alert-toggle > .switch {
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.share-form label.alert-toggle > .switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.share-form label.alert-toggle > input:checked + .switch {
  background: #1c3f60;
}
.share-form label.alert-toggle > input:checked + .switch::after {
  transform: translateX(16px);
}

/* the text */
.share-form label.alert-toggle > .label {
  white-space: nowrap;
  line-height: 1.2;
  color: #0b1320;
  font-size: 0.9rem;
}

.shared-tank-row {
  cursor: pointer;
}
.shared-tank-row:hover {
  border: solid 1px #0b1320 !important;
  border-radius: 1.2rem;
  font-weight: bold;
}

.highlighted-row td {
  animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
  0% {
    background-color: #174d80;
  } /* pale yellow */
  100% {
    background-color: transparent;
  }
}

/* Top nav */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(243, 246, 250, 0.9); /* light grey/white with transparency */
  backdrop-filter: blur(6px); /* frosted effect */
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Inner wrapper so nav aligns with dashboard width */
.top-nav-inner {
  max-width: 1000px; /* match your .dashboard-container */
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Links */
.top-nav a {
  color: #0b1320; /* dark text for contrast */
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}
.top-nav a:hover {
  color: #174d80; /* accent hover */
}

/* Emoji logo */
.nav-logo {
  font-size: 1.4rem;
}

/* Logout button */
.logout-btn {
  background: #e43f5a;
  border: none;
  padding: 0.5rem 1rem;
  color: #fff;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease;
}
.logout-btn:hover {
  background: #c12d48;
  transform: translateY(-2px);
}

/* Prevent content from being hidden under the nav */
body {
  padding-top: 60px;
}

/* === Fix for Edit Share sheet scrolling === */
#editShareSheet {
  max-height: 90vh; /* prevent it from overflowing the screen */
  overflow-y: auto; /* allow vertical scroll inside */
  padding-bottom: 2rem; /* ensure bottom buttons are not clipped */
  scroll-behavior: smooth;
}

#editShareSheet .sharesheet-body {
  padding-bottom: 3rem; /* extra space below Save/Cancel */
}

/* === Shared-With table rows (inside tank modal) === */
#sharedWithTable tr[data-share-id] {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#sharedWithTable tr[data-share-id]:hover td {
  background-color: #eaf1f7; /* light blue highlight */
  color: #0b1320; /* same text color as other hover rows */
  font-weight: 600;
}

/* optional: keep highlight style when row clicked */
#sharedWithTable tr.highlighted-row td {
  animation: flashHighlight 1.5s ease-out;
}

.no-results-row td {
  font-style: italic;
  background: #f7f9fb;
}
.search-input {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d0d7e2;
  border-radius: 0.4rem;
  width: 100%;
  max-width: 300px;
  transition: border-color 0.2s ease-in-out;
}

.search-input:focus {
  outline: none;
  border-color: #1c3f60;
  box-shadow: 0 0 0 1px #1c3f60;
}

.ack-btn {
  background-color: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease-in-out;
}
.ack-btn:hover {
  background-color: #1e3a8a;
}
.ack-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}
.page-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 0.4rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.page-btn:hover:not(:disabled) {
  background: #1e3a8a;
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

h1,
h2,
h3,
h4 {
  color: #0b1320;
  /* font-weight: 700; */
}

th {
  color: #0b1320;
}

.delete-tank-btn {
  padding: 0rem;
  font-size: 0.5rem;
  line-height: 0.5;
  border-radius: 0.4rem;
  background-color: #e43f5a !important;
}

/* ===============================
   TERMS & CONDITIONS MODALS ONLY
   =============================== */

.tc-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 32, 0.75);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.tc-modal-box {
  background: #f3f6fa;
  color: #0b1320;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

.tc-modal-box h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #0b1320;
}

.tc-modal-body {
  overflow-y: auto;
  max-height: 45vh;
  margin-bottom: 1.5rem;
}

.tc-modal-body p {
  color: #0b1320;
  line-height: 1.6;
}

.tc-modal-body a {
  color: #1c3f60;
  font-weight: 600;
}

.tc-close-btn {
  background: #1c3f60;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
}

.tc-close-btn:hover {
  background: #174d80;
}

/* ===============================
   TERMS CHECKBOX ROW
   =============================== */

.terms-row {
  margin: 1.2rem 0;
}

.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #0b1320;
}

.terms-checkbox input[type="checkbox"] {
  margin-top: 0.15rem;
}

.terms-checkbox a {
  color: #1c3f60;
  text-decoration: underline;
}

/* ===============================
   Legal pages (Terms / Privacy)
   =============================== */

.legal-page {
  background: #f3f6fa;
  color: #0b1320;
  padding: 3rem 1rem;
}

.legal-container {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.legal-container h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.legal-container p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ===============================
   FIX: Signup T&C checkbox layout
   =============================== */

.terms-row {
  margin: 1rem 0 1.25rem;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #0b1320;
}

/* 🔥 Override the global form input rule */
.terms-checkbox input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 auto;
}

/* Keep text as a single flow */
.terms-text {
  display: inline;
  line-height: 1.4;
}

/* Links styling */
.terms-text a {
  color: #1c3f60;
  text-decoration: underline;
  white-space: nowrap;
}

button.submit:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.nav-logo-img {
  height: 3.4rem;
  width: auto;
  margin-right: 1rem;
}
