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

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --pca-green: #2f5d3a;
  --pca-green-dark: #23452b;
  --pca-green-soft: #e8f1ea;
  --pca-ink: #1f2a24;
  --pca-muted: #55615a;
  --pca-sand: #f4f1e8;
  --pca-border: #d7ddd3;
}

body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--pca-ink);
  background: var(--pca-sand);
}

.page {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 2.1rem;
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: 0.3px;
}

.header p {
  margin: 0;
  color: var(--pca-muted);
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
  border: 1px solid var(--pca-border);
  box-shadow: 0 14px 30px rgba(31, 42, 36, 0.08);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-weight: 600;
  color: #334038;
}

.field input,
.field select {
  padding: 10px 12px;
  border: 1px solid var(--pca-border);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--pca-green);
  border-color: transparent;
}

.primary {
  background: var(--pca-green);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.primary:hover {
  background: var(--pca-green-dark);
}

.secondary {
  background: var(--pca-green-soft);
  color: var(--pca-ink);
  font-weight: 600;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.danger {
  background: #f8e3df;
  color: #8a1d2b;
  font-weight: 600;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--pca-muted);
  min-height: 22px;
}

.results {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-info .label {
  margin: 0;
  font-size: 0.85rem;
  color: #7b8794;
}

.user-info .value {
  margin: 0;
  font-weight: 600;
}

.admin-status {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0b6bcb;
  background: #e7f1ff;
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}

.section-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.section-subtitle {
  margin: 0;
  color: #7b8794;
  font-size: 0.95rem;
}

.admin-map {
  display: grid;
  gap: 12px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.admin-nav .tab {
  background: #f0f4f8;
  color: #1f2933;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.admin-nav .tab.active {
  background: #1f70ff;
  color: #fff;
}

.map-autoload {
  font-size: 0.85rem;
  color: #7b8794;
}

.penetration-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.penetration-item {
  border: 1px solid #e0e6ed;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
}

.penetration-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.penetration-title {
  font-weight: 600;
}

.penetration-metrics {
  font-size: 0.85rem;
  color: #52616b;
}

.penetration-details {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.penetration-details .panel-item {
  background: #f9fbfd;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
  align-items: end;
}

.report-table {
  margin-top: 16px;
  overflow: auto;
  border: 1px solid #e0e6ed;
  border-radius: 12px;
}

.report-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e0e6ed;
  text-align: left;
  font-size: 0.9rem;
}

.report-table thead th {
  background: #f5f7fa;
  font-weight: 600;
  color: #36454f;
  cursor: pointer;
  user-select: none;
}

.report-table tbody tr:hover {
  background: #f9fbfd;
}

.report-table thead th.sort-asc::after {
  content: " ▲";
  font-size: 0.75rem;
  color: #6b7785;
}

.report-table thead th.sort-desc::after {
  content: " ▼";
  font-size: 0.75rem;
  color: #6b7785;
}

.notice {
  border-left: 4px solid var(--pca-green);
  background: var(--pca-green-soft);
}

.notice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-success .section-title {
  margin-bottom: 8px;
}

.icon-button {
  margin-left: auto;
  border: none;
  background: transparent;
  color: #3f4b5a;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.icon-button:hover {
  color: #1f2a37;
}


.admin-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-map-layout {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    height: 420px;
  }
}

.map-canvas {
  width: 100%;
  height: 520px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e0e6ed;
}

.map-panel {
  border: 1px solid #e0e6ed;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  max-height: 520px;
  overflow: auto;
}

.map-panel h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.panel-subtitle {
  margin: 0 0 10px;
  color: #7b8794;
  font-size: 0.85rem;
}

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

.panel-item {
  border: 1px solid #e0e6ed;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
}

.panel-item strong {
  display: block;
  margin-bottom: 4px;
}

.panel-item .status-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 6px;
}

.panel-item .status-pill.active {
  background: #e6f4ea;
  color: #1e7e34;
}

.panel-item .status-pill.inactive {
  background: #fff3bf;
  color: #b3541e;
}

.panel-item .status-pill.none {
  background: #ffe3e3;
  color: #c92a2a;
}

.map-legend {
  display: grid;
  gap: 6px;
  background: #fff;
  padding: 12px;
  border: 1px solid #e0e6ed;
  border-radius: 10px;
  font-size: 0.9rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-dot.active {
  background: #2f9e44;
}

.legend-dot.member {
  background: #f08c00;
}

.legend-dot.none {
  background: #e03131;
}

.legend-note {
  color: #7b8794;
  font-size: 0.85rem;
}

.marker-cluster.marker-cluster-gradient {
  background: transparent !important;
}

.marker-cluster.marker-cluster-gradient > div {
  background: transparent !important;
  box-shadow: none !important;
}

.marker-cluster.marker-cluster-gradient .cluster-badge {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-align: center;
  background-clip: padding-box;
  color: #111;
}

.marker-cluster.marker-cluster-gradient .cluster-counts {
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  color: #111;
}

.result-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e0e6ed;
  background: #fdfefe;
}

.result-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.result-card p {
  margin: 4px 0;
  color: #4a5b66;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

.badge.active {
  background: #e6f4ea;
  color: #1e7e34;
}

.badge.expired {
  background: #fdecea;
  color: #b02a37;
}

.badge.unknown {
  background: #eef2f7;
  color: #52616b;
}
