:root {
  color-scheme: dark;
  --club-green: #009b5a;
  --club-green-dark: #006f42;
  --club-green-soft: #dff6ea;
  --bg: #f3f6f1;
  --bg-soft: #edf4ef;
  --ink: #13201a;
  --panel: #ffffff;
  --panel-strong: #eef4ef;
  --text: #13201a;
  --muted: #65736c;
  --line: #dbe4de;
  --accent: #009b5a;
  --accent-2: #c9a54b;
  --danger: #c43d3d;
  --shadow: 0 24px 70px rgba(15, 38, 28, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(0, 155, 90, 0.08), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

form {
  min-width: 0;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(0, 111, 66, 0.95), rgba(0, 155, 90, 0.78) 42%, rgba(19, 32, 26, 0.92)),
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.22), transparent 28%);
}

.login-backdrop::after {
  position: absolute;
  inset: auto -10% -18% -10%;
  height: 44%;
  background: rgba(255, 255, 255, 0.12);
  content: "";
  transform: skewY(-5deg);
}

.login-shell {
  position: relative;
  width: min(100%, 420px);
}

.login-panel,
.camera-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 32px;
  text-align: center;
}

.login-logo {
  display: block;
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--club-green);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.92),
    0 18px 38px rgba(0, 93, 56, 0.22);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.1;
}

.login-panel h1,
.login-panel .eyebrow,
.login-copy {
  text-align: center;
}

.login-copy {
  margin-bottom: 22px;
  color: var(--muted);
}

.wait-time {
  display: block;
  margin-bottom: 18px;
  color: var(--club-green-dark);
  font-size: 2rem;
  text-align: center;
}

.wait-note {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.return-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--club-green-dark);
  font-weight: 700;
  text-decoration: none;
}

.login-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.login-contact {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  text-align: center;
}

.login-contact span {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-contact a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 155, 90, 0.26);
  border-radius: 6px;
  background: var(--club-green-soft);
  color: var(--club-green-dark);
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
}

.login-contact a:hover {
  border-color: var(--club-green);
  background: #ffffff;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfb;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--club-green-dark);
  padding: 0;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  border-color: rgba(0, 155, 90, 0.22);
  background: var(--club-green-soft);
}

.eye-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px / 70%;
}

.eye-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.password-toggle[aria-pressed="true"] .eye-icon::before {
  position: absolute;
  top: 50%;
  left: -3px;
  width: 25px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: rotate(-38deg);
}

button {
  min-height: 44px;
  max-width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--club-green);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover {
  background: var(--club-green-dark);
  box-shadow: 0 12px 28px rgba(0, 111, 66, 0.24);
  transform: translateY(-1px);
}

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

.nav-button {
  display: inline-flex;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
  text-align: center;
}

.danger-button {
  min-height: 38px;
  background: #fff0ef;
  color: var(--danger);
  border: 1px solid #f2c6c3;
}

.danger-button:hover {
  background: #ffe1df;
  box-shadow: none;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 0.92rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(120deg, var(--club-green-dark), var(--club-green));
  color: #ffffff;
  box-shadow: 0 18px 45px rgba(0, 89, 53, 0.22);
}

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.brand-block {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: left;
}

.brand-logo {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 50%;
  background: var(--club-green);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.88),
    0 12px 30px rgba(0, 0, 0, 0.18);
}

.topbar .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.topbar-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  min-width: 0;
}

.session-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0 14px;
  white-space: nowrap;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(1180px, calc(100% - clamp(32px, 8vw, 76px)));
  margin: clamp(18px, 4vw, 34px) auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: 0 16px 45px rgba(15, 38, 28, 0.08);
}

.status-strip div {
  display: grid;
  gap: 4px;
  background: #ffffff;
  padding: 16px 18px;
  text-align: center;
}

.status-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status-strip strong {
  font-size: 1rem;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, calc(100% - clamp(32px, 8vw, 76px)));
  margin: 0 auto;
  padding: 18px 0 clamp(24px, 4vw, 42px);
}

.camera-card {
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 38, 28, 0.12);
}

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfdfb);
}

.camera-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.2;
}

.viewer-view .camera-header {
  justify-content: center;
  text-align: center;
}

.viewer-view .camera-header h2 {
  font-size: 1.16rem;
}

.camera-header span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--club-green-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 9px;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(0, 155, 90, 0.22), rgba(19, 32, 26, 0.86)),
    #0f1512;
}

.video-frame video,
.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.court-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9e2ca;
  border-radius: 999px;
  background: #e9f8ef;
  color: var(--club-green-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 10px;
}

.court-badge.interdicted {
  border-color: #f0c8c4;
  background: #fff0ef;
  color: var(--danger);
}

.court-badge.moisture {
  border-color: #d8d0ad;
  background: #fff9e6;
  color: #7a5f12;
}

.empty-camera {
  display: grid;
  height: 100%;
  place-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  padding: 18px;
  text-align: center;
}

.empty-camera strong {
  color: #ffffff;
}

.admin-shell {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - clamp(32px, 8vw, 76px)));
  margin: 0 auto;
  padding: clamp(16px, 4vw, 38px);
  padding-right: 0;
  padding-left: 0;
}

.admin-panel,
.notice,
.token-result {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(15, 38, 28, 0.08);
}

.admin-panel {
  padding: clamp(18px, 3vw, 26px);
}

.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-overview article {
  min-width: 0;
  border: 1px solid rgba(0, 155, 90, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f3fbf6);
  box-shadow: 0 14px 36px rgba(15, 38, 28, 0.07);
  padding: 16px;
}

.dashboard-overview span,
.dashboard-overview small {
  display: block;
  color: var(--muted);
}

.dashboard-overview span {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-overview strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--club-green-dark);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.dashboard-overview strong[data-state="warning"] {
  color: #755407;
}

.dashboard-overview strong[data-state="offline"] {
  color: #8b1e1e;
}

.dashboard-overview small {
  font-size: 0.86rem;
}

.dashboard-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 28px rgba(15, 38, 28, 0.07);
  padding: 10px;
  backdrop-filter: blur(8px);
}

.dashboard-nav a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--club-green-dark);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0 12px;
  text-decoration: none;
}

.dashboard-nav a:hover,
.dashboard-nav a:focus-visible {
  border-color: rgba(0, 155, 90, 0.22);
  background: var(--club-green-soft);
}

.dashboard-category {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 10px;
  scroll-margin-top: 74px;
}

.dashboard-category span {
  color: var(--club-green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-category h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.15;
}

.notice {
  color: var(--club-green-dark);
  font-weight: 700;
  padding: 14px 16px;
}

.token-result {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.token-result span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.token-result strong {
  overflow-wrap: anywhere;
}

.password-status {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px 14px;
}

.password-status strong {
  color: var(--club-green-dark);
}

.password-status.default strong {
  color: #7a5f12;
}

.password-status span {
  color: var(--muted);
  font-size: 0.9rem;
}

.access-counter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(0, 155, 90, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #f3fbf6, #ffffff);
  padding: 16px;
}

.access-counter-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.access-counter-card strong {
  display: block;
  margin-top: 4px;
  color: var(--club-green-dark);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.access-counter-card small {
  color: var(--muted);
  text-align: right;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
}

.service-health-panel {
  display: grid;
  gap: 14px;
}

.service-health-simple {
  gap: 16px;
}

.service-health-simple-summary {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 800;
}

.service-health-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.service-health-list-head,
.service-health-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 160px) minmax(100px, 140px);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.service-health-list-head {
  background: #f3fbf6;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.service-health-list-row {
  border-top: 1px solid var(--line);
}

.service-health-list-row strong {
  color: var(--text);
}

.service-health-list-row span:nth-child(2) {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.service-health-list-row span:nth-child(3) {
  color: var(--muted);
  font-weight: 800;
}

.service-health-summary {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 800;
}

.service-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.service-health-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fbfdfb;
  padding: 13px 14px;
}

.service-health-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-health-card strong {
  color: var(--text);
}

.service-health-card-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.service-health-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.service-health-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.service-state-online {
  border-color: rgba(0, 155, 90, 0.28);
  border-left-color: var(--club-green);
  background: #f4fbf7;
  color: var(--club-green-dark);
}

.service-health-list-row.service-state-online span:nth-child(2) {
  background: #e3f7ec;
  color: var(--club-green-dark);
}

.service-state-online .service-health-card-head span {
  background: #e3f7ec;
  color: var(--club-green-dark);
}

.service-state-warning {
  border-color: rgba(178, 131, 20, 0.3);
  border-left-color: #b28314;
  background: #fffaf0;
  color: #755407;
}

.service-health-list-row.service-state-warning span:nth-child(2) {
  background: #fff0c7;
  color: #755407;
}

.service-state-warning .service-health-card-head span {
  background: #fff0c7;
  color: #755407;
}

.service-state-offline {
  border-color: rgba(166, 45, 45, 0.28);
  border-left-color: #a62d2d;
  background: #fff6f6;
  color: #8b1e1e;
}

.service-health-list-row.service-state-offline span:nth-child(2) {
  background: #fde1e1;
  color: #8b1e1e;
}

.service-state-offline .service-health-card-head span {
  background: #fde1e1;
  color: #8b1e1e;
}

.service-state-loading {
  border-color: var(--line);
  border-left-color: #8a9a91;
  background: #f8fbf9;
  color: var(--muted);
}

.service-health-list-row.service-state-loading span:nth-child(2) {
  background: #edf3ef;
  color: var(--muted);
}

.service-state-loading .service-health-card-head span {
  background: #edf3ef;
  color: var(--muted);
}

.service-health-dashboard {
  gap: 22px;
  padding: clamp(20px, 3vw, 28px);
}

.service-health-titlebar {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.service-title-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(0, 155, 90, 0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fbf7, #ffffff);
  color: var(--club-green-dark);
  font-size: 2rem;
  font-weight: 900;
}

.service-health-titlebar h2 {
  margin: 0;
  color: #0f1b2d;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.service-health-titlebar p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #4d6078;
  font-size: 1rem;
}

.service-health-dashboard .compact-button {
  border-color: rgba(0, 155, 90, 0.4);
  color: var(--club-green-dark);
  min-width: 118px;
}

.service-health-dashboard .service-health-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(0, 2fr);
  align-items: center;
  gap: 24px;
  border: 1px solid rgba(0, 155, 90, 0.28);
  border-left-width: 8px;
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(15, 38, 28, 0.09);
  padding: 22px 24px;
}

.service-summary-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.service-summary-icon,
.service-card-icon,
.service-health-note > span {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f7ee;
  color: var(--club-green-dark);
  font-weight: 900;
}

.service-summary-icon {
  width: 52px;
  height: 52px;
  background: var(--club-green);
  color: #ffffff;
  font-size: 1.8rem;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.22);
}

.service-summary-main strong {
  display: block;
  color: var(--club-green-dark);
  font-size: 1.1rem;
}

.service-summary-main span {
  display: block;
  margin-top: 6px;
  color: #4b7f61;
}

.service-summary-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
}

.service-summary-counts div {
  display: grid;
  justify-items: center;
  gap: 6px;
  border-left: 1px solid var(--line);
  padding: 4px 14px;
}

.service-summary-counts strong {
  color: #0f1b2d;
  font-size: 2rem;
  line-height: 1;
}

.service-summary-counts span {
  color: var(--club-green-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.service-summary-counts div:nth-child(2) span {
  color: #b28314;
}

.service-summary-counts div:nth-child(3) span {
  color: #4d5966;
}

.service-health-dashboard .service-health-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.service-health-dashboard .service-health-card {
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  min-height: 92px;
  border-radius: 10px;
  border-left-width: 5px;
  box-shadow: 0 10px 26px rgba(15, 38, 28, 0.08);
  padding: 16px;
}

.service-card-icon {
  width: 50px;
  height: 50px;
  font-size: 1.55rem;
}

.service-card-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.service-health-dashboard .service-health-card-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
}

.service-health-dashboard .service-health-card-head span::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.service-health-dashboard .service-health-card p {
  color: #4d6078;
}

.service-health-dashboard .service-health-card small {
  color: #586b82;
}

.service-health-note {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(0, 155, 90, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, #f2fbf7, #ffffff);
  padding: 14px 16px;
}

.service-health-note > span {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: var(--club-green);
  color: #ffffff;
}

.service-health-note strong,
.service-health-note small {
  display: block;
}

.service-health-note strong {
  color: var(--text);
}

.service-health-note small {
  margin-top: 4px;
  color: var(--muted);
}

.court-status-grid {
  display: grid;
  gap: 14px;
}

.court-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 14px;
}

.court-status-head span,
.court-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.court-status-head strong {
  display: block;
  margin-top: 4px;
}

.court-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.court-status-card {
  display: grid;
  gap: 14px;
}

.court-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.court-status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.court-status-form button {
  min-width: 150px;
}

.court-meta {
  margin: 0;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.camera-admin-list {
  display: grid;
  gap: 14px;
}

.policy-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(220px, auto) auto;
  align-items: end;
  gap: 14px;
}

.media-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 14px;
}

.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plain-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--club-green-dark);
  font-weight: 700;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.camera-admin-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr);
  gap: 14px;
}

.rtsp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 14px;
}

.generated-box {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.generated-box span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.generated-box strong,
.generated-box code {
  overflow-wrap: anywhere;
}

.generated-box code {
  color: var(--muted);
  font-family: Consolas, Monaco, monospace;
  font-size: 0.86rem;
  line-height: 1.45;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.remember-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: flex-start;
  justify-self: stretch;
  gap: 9px;
  width: 100%;
  max-width: 100%;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.remember-line input[type="checkbox"] {
  appearance: auto;
  flex: 0 0 auto;
  min-width: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.remember-line span {
  display: inline;
  min-width: 0;
}

.captcha-box {
  display: grid;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbf8;
  padding: 12px 14px;
  text-align: left;
}

.captcha-answer {
  display: grid;
  grid-template-columns: 1fr auto minmax(86px, 120px);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.captcha-answer span {
  color: var(--muted);
}

.captcha-answer strong {
  color: var(--club-green-dark);
  font-size: 1rem;
}

.captcha-answer input {
  justify-self: stretch;
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  text-align: center;
}

.check-line input {
  width: 18px;
  height: 18px;
}

.policy-check {
  min-height: 44px;
  color: var(--text);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.list-table {
  display: grid;
  gap: 10px;
}

.list-table p {
  margin: 0;
  color: var(--muted);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 12px;
}

.list-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.list-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand-block {
    grid-column: 1;
    justify-content: flex-start;
  }

  .topbar-actions {
    grid-column: 2;
  }

  .camera-grid {
    gap: 14px;
  }

  .policy-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .policy-form button,
  .media-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .brand-block,
  .topbar-actions {
    grid-column: 1;
  }

  .brand-block {
    justify-content: center;
  }

  .topbar-actions {
    justify-self: center;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

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

  .admin-grid,
  .court-status-grid,
  .service-health-grid,
  .dashboard-overview,
  .policy-form,
  .form-row {
    grid-template-columns: 1fr;
  }

  .service-health-list-head,
  .service-health-list-row {
    grid-template-columns: minmax(160px, 1fr) minmax(100px, 130px) minmax(86px, 110px);
  }

  .service-health-titlebar,
  .service-health-dashboard .service-health-summary {
    grid-template-columns: 1fr;
  }

  .service-health-titlebar {
    justify-items: start;
  }

  .service-health-dashboard .service-health-grid {
    grid-template-columns: 1fr;
  }

  .service-summary-counts div:first-child {
    border-left: 0;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(0, 155, 90, 0.1), transparent 220px),
      var(--bg);
  }

  .login-page {
    min-height: 100svh;
    align-items: start;
    overflow: auto;
    padding: 18px 14px;
  }

  .login-shell {
    width: 100%;
  }

  .login-panel {
    padding: 24px 18px;
  }

  .login-logo {
    width: 108px;
    height: 108px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
    justify-items: center;
    text-align: center;
    padding: 16px;
  }

  .brand-block,
  .topbar-actions {
    grid-column: 1;
  }

  .brand-block {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    justify-self: center;
    gap: 10px;
  }

  .topbar-actions form {
    flex: 1 1 130px;
  }

  .topbar-actions .nav-button,
  .topbar-actions button {
    width: 100%;
  }

  .session-pill {
    flex: 1 1 100%;
    justify-content: center;
  }

  .dashboard-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
  }

  .dashboard-nav a {
    flex: 0 0 auto;
  }

  .service-health-list-head {
    display: none;
  }

  .service-health-list-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .service-health-list-row span:nth-child(2),
  .service-health-list-row span:nth-child(3) {
    justify-self: start;
  }

  .service-health-dashboard .service-health-summary {
    gap: 18px;
    padding: 18px;
  }

  .service-summary-counts {
    grid-template-columns: 1fr;
  }

  .service-summary-counts div {
    justify-items: start;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .service-health-dashboard .service-health-card {
    grid-template-columns: 1fr;
  }

  .service-health-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .remember-line {
    align-items: flex-start;
    justify-self: start;
  }

  .remember-line input[type="checkbox"] {
    margin-top: 2px;
  }

  .captcha-answer {
    grid-template-columns: 1fr auto;
  }

  .captcha-answer input {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
  }

  .brand-logo {
    width: 76px;
    height: 76px;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .status-strip {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
  }

  .camera-grid {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .form-row,
  .policy-form,
  .media-form,
  .rtsp-grid,
  .court-status-form {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    width: calc(100% - 32px);
    padding-top: 16px;
    padding-bottom: 24px;
  }

  .admin-panel,
  .camera-admin-card {
    padding: 16px;
  }

  .split-heading {
    flex-direction: column;
  }

  .access-counter-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-counter-card small {
    text-align: left;
  }

  .list-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 1.45rem;
  }

  .topbar {
    padding: 14px 12px;
  }

  .brand-logo {
    width: 68px;
    height: 68px;
  }

  .status-strip,
  .camera-grid,
  .admin-shell {
    width: calc(100% - 20px);
  }

  .status-strip div {
    padding: 13px 12px;
  }

  .camera-header {
    min-height: 54px;
    padding: 0 14px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .viewer-view .camera-header h2 {
    font-size: 1.05rem;
  }

  .video-frame {
    aspect-ratio: 4 / 3;
  }

  .admin-panel,
  .camera-admin-card {
    padding: 14px;
  }

  .list-row form,
  .list-row button,
  .plain-link {
    width: 100%;
  }
}
