/* WWF POD + driver shared UI (loads after wwf-avenir.css) */

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

body {
  font-family: var(--wwf-font);
  margin: 0;
  background: var(--wwf-bg);
  color: var(--wwf-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 700;
  color: var(--wwf-navy);
  letter-spacing: -0.02em;
}

a { color: var(--wwf-navy-light); font-weight: 500; }
a:hover { color: #1565c0; }

button, .btn, input[type="submit"] {
  font-family: var(--wwf-font);
  font-weight: 600;
  letter-spacing: 0.01em;
}

nav.wwf-nav {
  background: var(--wwf-navy);
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
nav.wwf-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
nav.wwf-nav a:hover { opacity: 0.9; }
nav.wwf-nav .right {
  margin-left: auto;
  font-weight: 400;
  font-size: 0.88rem;
  opacity: 0.92;
}

nav.wwf-nav .wwf-nav-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

nav.wwf-nav .wwf-nav-menu {
  position: relative;
}

nav.wwf-nav .wwf-nav-menu summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  user-select: none;
}

nav.wwf-nav .wwf-nav-menu summary::-webkit-details-marker {
  display: none;
}

nav.wwf-nav .wwf-nav-menu summary::after {
  content: " ▾";
  font-size: 0.75rem;
  opacity: 0.85;
}

nav.wwf-nav .wwf-nav-menu[open] summary {
  background: rgba(255, 255, 255, 0.12);
}

nav.wwf-nav .wwf-nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 11.5rem;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  padding: 0.35rem 0;
  z-index: 200;
}

nav.wwf-nav .wwf-nav-dropdown a {
  display: block;
  color: var(--wwf-navy);
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

nav.wwf-nav .wwf-nav-dropdown a:hover {
  background: #f0f2f8;
  opacity: 1;
}

nav.wwf-nav .wwf-nav-user a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Perth / Melbourne lights — always one line, inside nav (never a second strip) */
.wwf-region-lights,
.wwf-region-lights--inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  color: #e8eaf6;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: auto;
  max-width: none;
  flex-shrink: 0;
}
.wwf-region-lights-title { display: none; }
.wwf-region-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
.wwf-region-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #9e9e9e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.wwf-region-item.is-online .wwf-region-dot {
  background: #43a047;
  box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.35), 0 0 6px rgba(67, 160, 71, 0.55);
}
.wwf-region-item.is-offline .wwf-region-dot {
  background: #e53935;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.35), 0 0 6px rgba(229, 57, 53, 0.5);
}
.wwf-region-item.is-checking .wwf-region-dot,
.wwf-region-item.is-unknown .wwf-region-dot {
  background: #bdbdbd;
  box-shadow: 0 0 0 2px rgba(189, 189, 189, 0.25);
}
.wwf-region-item.is-checking .wwf-region-dot {
  animation: wwf-region-pulse 1.2s ease-in-out infinite;
}
@keyframes wwf-region-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.wwf-region-label { color: #fff; font-size: 0.78rem; }
.wwf-region-state { display: none; } /* title attribute carries Online/Offline */

nav.wwf-nav .wwf-region-lights {
  order: 0;
}
nav.wwf-nav--login {
  justify-content: space-between;
}
nav.wwf-nav--login .wwf-nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

main.wwf-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.card {
  background: var(--wwf-surface);
  border-radius: var(--wwf-radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--wwf-shadow);
  border: 1px solid var(--wwf-border);
}

.card h1 { margin: 0 0 0.5rem; font-size: 1.35rem; }
.card h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.card p { margin: 0.35rem 0; color: var(--wwf-muted); font-size: 0.95rem; }

input, select, textarea {
  font-family: var(--wwf-font);
  padding: 0.5rem 0.65rem;
  border: 1px solid #c5c9d0;
  border-radius: 6px;
  font-size: 0.95rem;
}

button, .btn-primary {
  background: var(--wwf-navy);
  color: #fff;
  border: 0;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
}
button:hover, .btn-primary:hover { background: var(--wwf-navy-light); }

.err { background: #ffebee; color: #b71c1c; padding: 0.65rem; border-radius: 6px; }
.ok { background: #e8f5e9; color: #1b5e20; padding: 0.65rem; border-radius: 6px; }

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid #eee;
}
th { background: #f5f6f8; font-weight: 600; color: var(--wwf-navy); }

.job-place { font-size: 1.05rem; font-weight: 700; color: var(--wwf-navy); line-height: 1.25; }
.job-meta { font-size: 0.78rem; color: #444; margin-top: 0.12rem; line-height: 1.35; word-break: break-word; }
.job-extra { display: block; font-size: 0.74rem; color: var(--wwf-muted); margin-top: 0.15rem; }

.muted { color: var(--wwf-muted); font-size: 0.9rem; }

label.field-label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-size: 0.85rem;
  color: var(--wwf-muted);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag.admin { background: #e3f2fd; color: #0d47a1; }
.tag.on { background: #e8f5e9; color: #1b5e20; }
.tag.off { background: #eee; color: #666; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.filter-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--wwf-border);
  background: #fff;
  color: var(--wwf-navy);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
}
.filter-pill.active {
  background: var(--wwf-navy);
  color: #fff;
  border-color: var(--wwf-navy);
}
.staff-table td.actions { white-space: nowrap; }
.inline-delete { display: inline; margin: 0; padding: 0; }
.btn-danger-link {
  border: 0;
  background: none;
  color: #c62828;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}
.btn-danger-link:hover { text-decoration: underline; }
.inline-reset-2fa {
  display: inline;
  margin: 0;
  padding: 0;
}
.portal-table td.actions { white-space: nowrap; }

.tfa-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.tfa-admin-actions form { margin: 0; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.btn-danger {
  background: #c62828;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.btn-restore-link {
  border: 0;
  background: none;
  color: #1565c0;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}
.btn-restore-link:hover { text-decoration: underline; }

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.portal-table th,
.portal-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--wwf-border);
}
.portal-table th {
  font-weight: 600;
  color: var(--wwf-navy);
}

.service-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 0.75rem;
  margin-top: 0.5rem;
}

.service-access-opt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
}

.service-rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.45rem 0.75rem;
  margin-top: 0.5rem;
}

.service-rate-row {
  display: grid;
  grid-template-columns: 1fr 5.5rem;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.9rem;
}

.micro-grid--pricing {
  max-width: 24rem;
}
.status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}
.status-submitted,
.status-under_review { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

.contact-picker {
  position: relative;
  max-width: 420px;
}
.contact-picker-input {
  width: 100%;
}
.contact-picker-results {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--wwf-surface);
  border: 1px solid var(--wwf-border);
  border-radius: 6px;
  box-shadow: var(--wwf-shadow);
}
.contact-picker-item {
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font-size: 0.92rem;
  border-bottom: 1px solid #eef0f4;
}
.contact-picker-item:last-child { border-bottom: none; }
.contact-picker-item:hover {
  background: #e8eaf6;
}
.contact-picker-item.active {
  background: #c5cae9;
  outline: 2px solid var(--wwf-navy);
  outline-offset: -2px;
}
.contact-picker-empty {
  padding: 0.55rem 0.65rem;
  color: var(--wwf-muted);
  font-size: 0.88rem;
}