.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-primary-button,
.admin-secondary-button,
.admin-danger-button {
  width: auto;
  border-radius: 8px;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.admin-primary-button {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.admin-secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.admin-danger-button {
  border: 1px solid #e3b9b9;
  background: #fff;
  color: #9d3434;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}

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

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
}

.role-badge {
  display: inline-block;
  border-radius: 12px;
  padding: 4px 8px;
  background: #edf2f4;
  font-size: 11px;
  font-weight: 700;
}

.state-enabled {
  color: #17764f;
}

.state-disabled {
  color: #a33b3b;
}

.admin-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.admin-select {
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  font: inherit;
}

.admin-access-title {
  margin: 12px 0 18px;
  font-weight: 700;
}

.access-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.grant-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(10,30,35,.45);
}

.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 15px;
  padding: 26px;
  box-shadow: 0 20px 70px rgba(0,0,0,.18);
}

.modal-title {
  margin-bottom: 20px;
  font-size: 21px;
  font-weight: 700;
}

.modal-card label {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}

.modal-card input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.admin-error {
  min-height: 18px;
  margin-top: 12px;
  color: #a33737;
  font-size: 13px;
}

@media (max-width: 700px) {
  .admin-heading,
  .access-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .grant-row,
  .grant-row .admin-select,
  .grant-row button {
    width: 100%;
  }
}


/* =========================================================
   WATERMAN STATION PROFILE v1
   ========================================================= */

.station-profile-panel {
  margin-top: 20px;
}

.profile-station-selector {
  min-width: 320px;
}

.profile-grid {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 18px;

  margin-top: 24px;
}

.profile-grid label {
  display: block;

  font-size: 13px;
  font-weight: 600;
}

.profile-grid input,
.profile-grid textarea {
  width: 100%;

  margin-top: 7px;

  border: 1px solid var(--line);

  border-radius: 8px;

  background: #fff;

  padding: 10px 11px;

  font: inherit;

  color: var(--text);

  outline: none;
}

.profile-grid input:focus,
.profile-grid textarea:focus {
  border-color: var(--accent);
}

.profile-grid textarea {
  resize: vertical;
}

.profile-wide {
  grid-column: 1 / -1;
}

.profile-actions {
  display: flex;

  align-items: center;
  justify-content: flex-end;

  gap: 18px;

  margin-top: 22px;
}

.profile-status {
  margin-right: auto;

  font-size: 13px;

  color: var(--muted);
}

.profile-status.ok {
  color: #17764f;
}

.profile-status.error {
  color: #a33737;
}

@media (max-width: 800px) {

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-wide {
    grid-column: auto;
  }

  .profile-station-selector {
    width: 100%;
    min-width: 0;
  }

  .profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-status {
    margin-right: 0;
  }

  .profile-actions button {
    width: 100%;
  }
}


/* =========================================================
   WATERMAN MODAL VISIBILITY FIX
   ========================================================= */

.modal-backdrop[hidden] {
  display: none !important;
}



/* WATERMAN navigation readability safeguard */
.waterman-main-nav .nav-link {
  color: rgba(255,255,255,.86);
  text-decoration: none;
}

.waterman-main-nav .nav-link:visited {
  color: rgba(255,255,255,.86);
}

.waterman-main-nav .nav-link:hover,
.waterman-main-nav .active-link,
.waterman-main-nav .active-link:visited {
  color: #fff;
}



/* =========================================================
   WATERMAN OBJECT PROFILE UX v2
   ========================================================= */

.wm-profile-sections {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.wm-profile-section {
  border: 1px solid
    rgba(24, 72, 82, .14);

  border-radius: 16px;

  background: #ffffff;

  overflow: hidden;
}

.wm-profile-section-heading {
  padding: 18px 20px;

  background:
    linear-gradient(
      180deg,
      rgba(19, 91, 104, .06),
      rgba(19, 91, 104, .025)
    );

  border-bottom:
    1px solid
    rgba(24, 72, 82, .10);
}

.wm-profile-section-title {
  color: #173b43;

  font-size: 18px;

  line-height: 1.25;

  font-weight: 750;
}

.wm-profile-section-subtitle {
  margin-top: 5px;

  color: #70858a;

  font-size: 13px;

  line-height: 1.45;
}

.wm-profile-section-grid {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 18px 20px;

  padding: 20px;
}

.wm-profile-field {
  min-width: 0;
  margin: 0 !important;
}

.wm-profile-field label {
  display: block;
  margin: 0;
}

.wm-field-label {
  display: block;

  margin-bottom: 7px;

  color: #294850;

  font-size: 13px;

  line-height: 1.3;

  font-weight: 650;
}

.wm-profile-field input,
.wm-profile-field select,
.wm-profile-field textarea {
  width: 100%;

  box-sizing: border-box;
}

.wm-profile-subheading {
  grid-column: 1 / -1;

  margin-top: 5px;

  padding-top: 18px;

  border-top:
    1px solid
    rgba(24, 72, 82, .10);
}

.wm-profile-subheading-title {
  color: #173b43;

  font-size: 15px;

  font-weight: 750;
}

.wm-profile-subheading-note {
  margin-top: 3px;

  color: #7a8c90;

  font-size: 12px;
}

.wm-profile-section-technical
.wm-profile-section-heading {
  background:
    linear-gradient(
      180deg,
      rgba(34, 57, 70, .055),
      rgba(34, 57, 70, .020)
    );
}


/* Larger notes field */
#profileNotes {
  min-height: 90px;
}


/* Mobile / narrow layout */
@media (
  max-width: 900px
) {

  .wm-profile-section-grid {
    grid-template-columns: 1fr;
  }

  .wm-profile-subheading {
    grid-column: 1;
  }
}



/* WATERMAN sidebar browser-link override */
.sidebar a,
.sidebar a:link,
.sidebar a:visited,
.sidebar .nav-link,
.sidebar .nav-link:link,
.sidebar .nav-link:visited,
.waterman-main-nav a,
.waterman-main-nav a:link,
.waterman-main-nav a:visited {
  color: rgba(238,247,248,.88) !important;
  text-decoration: none !important;
}

.sidebar a:hover,
.sidebar .nav-link:hover,
.waterman-main-nav a:hover,
.sidebar .active-link,
.sidebar .active-link:visited,
.waterman-main-nav .active-link,
.waterman-main-nav .active-link:visited {
  color: #fff !important;
}

