/* Admin dashboard — extends styles.css */

.admin-shell {
  min-height: calc(100vh - 140px);
  padding: 48px 0 80px;
}

.login-card {
  max-width: 420px;
  margin: 40px auto;
  text-align: center;
}
.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1.05rem;
  margin: 16px 0;
  font-family: inherit;
}
.login-error {
  color: var(--old-glory-red);
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 8px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}
.field textarea { resize: vertical; }
.field .hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }

.progress-preview {
  background: var(--stone);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-preview-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--old-glory-red));
}

.update-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  background: var(--white);
}
.update-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.update-item-head h4 { margin: 0 0 4px; color: var(--navy); }
.update-item-date { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; }
.update-item-body { color: var(--ink-soft); margin-top: 8px; white-space: pre-wrap; }
.update-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.update-item-actions button {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}
.update-item-actions button:hover { background: var(--stone); }
.update-item-actions .danger { color: var(--old-glory-red); border-color: var(--old-glory-red); }

.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.photo-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.photo-thumb-wrap { position: relative; }
.photo-thumb-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--old-glory-red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
  padding: 0;
}

.status-msg {
  font-size: 0.88rem;
  font-weight: 700;
  margin-left: 12px;
}
.status-msg.ok { color: #2f7a3d; }
.status-msg.err { color: var(--old-glory-red); }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ---------- Tabs + analytics ---------- */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.admin-tab {
  border: none;
  background: none;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.admin-tab:hover { color: var(--navy); }
.admin-tab.is-active { color: var(--navy); border-bottom-color: var(--old-glory-red); }

.analytics-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.range-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.range-btn {
  border: none;
  background: var(--white);
  padding: 8px 14px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}
.range-btn + .range-btn { border-left: 1px solid var(--border); }
.range-btn.is-active { background: var(--navy); color: var(--white); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { font-weight: 700; margin-top: 4px; font-size: 0.9rem; }
.stat-sub { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }

.chart-plot { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 8px; border-bottom: 1px solid var(--border); }
.chart-col { flex: 1; height: 100%; min-width: 0; }
.chart-bars { position: relative; height: 100%; }
.chart-bar { position: absolute; bottom: 0; border-radius: 2px 2px 0 0; min-height: 1px; }
.chart-bar.views { left: 0; right: 0; background: var(--navy); opacity: 0.85; }
.chart-bar.visitors { left: 22%; width: 56%; background: var(--gold); }
.chart-axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-soft); margin-top: 6px; }
.chart-legend { font-size: 0.8rem; color: var(--ink-soft); margin-top: 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 12px; }
.dot:first-child { margin-left: 0; }
.dot-views { background: var(--navy); }
.dot-visitors { background: var(--gold); }

.analytics-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 24px 0;
}
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { margin-bottom: 12px; }
.bar-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.bar-num { font-weight: 700; color: var(--navy); }
.bar-track { background: var(--stone); height: 6px; border-radius: 999px; margin-top: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--old-glory-red)); }
.funnel-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.funnel-table th, .funnel-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.funnel-table th:not(:first-child), .funnel-table td:not(:first-child) { text-align: right; }

[hidden] { display: none !important; }
