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

:root {
  --hp-bg: #0b1b2b;
  --hp-bg-soft: #0f2538;
  --hp-card: #ffffff;
  --hp-border-subtle: #e2e8f0;
  --hp-text: #1e293b;
  --hp-text-soft: #64748b;
  --hp-accent: #16a34a;
  --hp-accent-soft: rgba(22, 163, 74, 0.1);
  --hp-warning: #eab308;
  --hp-danger: #dc2626;
  --hp-radius-lg: 18px;
  --hp-radius-pill: 999px;
  --hp-shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.12);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f1f5f9;
  color: var(--hp-text);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */

.hp-header {
  background: radial-gradient(circle at top left, #22c55e 0, #16a34a 24%, #0f172a 70%);
  color: white;
  padding: 18px 24px;
}

.hp-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.hp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hp-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.hp-logo-text {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hp-title-block h1 {
  margin: 0;
  font-size: 24px;
}

.hp-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

/* Layout */

.hp-main {
  max-width: 1120px;
  margin: 18px auto 40px;
  padding: 0 16px;
  flex: 1;
}

.hp-top-summary {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.hp-kpi {
  background: white;
  border-radius: var(--hp-radius-lg);
  padding: 14px 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--hp-border-subtle);
}

.hp-kpi--wide {
  padding-bottom: 16px;
}

.hp-kpi--stacked {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hp-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hp-text-soft);
}

.hp-kpi-title {
  margin: 4px 0 2px;
  font-size: 18px;
}

.hp-kpi-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--hp-text-soft);
}

.hp-kpi-value {
  font-size: 18px;
  font-weight: 600;
}

.hp-kpi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.hp-kpi-row span:first-child {
  color: var(--hp-text-soft);
}

.hp-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.hp-kpi-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--hp-text-soft);
}

.hp-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.hp-dot--warning {
  background: #f97316;
}

/* Happening right now */

.hp-happening-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.hp-happening-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  gap: 10px;
}

.hp-happening-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hp-happening-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.hp-happening-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hp-happening-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-happening-subtitle {
  font-size: 11px;
  color: var(--hp-text-soft);
}

.hp-happening-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hp-progress-circle {
  --value: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    conic-gradient(var(--hp-accent) calc(var(--value) * 1%), #e5e7eb 0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--hp-text);
}

.hp-progress-inner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-subscribe-link {
  font-size: 11px;
  color: var(--hp-text-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hp-subscribe-link::before {
  content: "\1F514";
  font-size: 12px;
}

/* Tabs */

.hp-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: white;
  border-radius: var(--hp-radius-pill);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin-bottom: 18px;
}

.hp-tab {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: var(--hp-radius-pill);
  font-size: 13px;
  cursor: pointer;
  color: var(--hp-text-soft);
  font-weight: 500;
}

.hp-tab.active {
  background: var(--hp-accent-soft);
  color: #14532d;
}

/* Panels */

.hp-panel {
  display: none;
}

.hp-panel.active {
  display: block;
}

.hp-panel-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.hp-panel-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.hp-panel-description {
  margin: 0;
  font-size: 13px;
  color: var(--hp-text-soft);
}

.hp-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hp-filters input[type="search"],
.hp-filters select {
  border-radius: 999px;
  border: 1px solid var(--hp-border-subtle);
  padding: 8px 12px;
  font-size: 13px;
  background: white;
}

.hp-filters input[type="search"] {
  min-width: 220px;
}

/* Table */

.hp-table-wrapper {
  background: white;
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow-soft);
  border: 1px solid var(--hp-border-subtle);
  overflow: hidden;
}

.hp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hp-table th,
.hp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.hp-table th {
  text-align: left;
  background: #f9fafb;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hp-text-soft);
}

.hp-table tr:last-child td {
  border-bottom: none;
}

.hp-table tbody tr {
  cursor: pointer;
}

.hp-table tbody tr:hover {
  background: #f8fafc;
}

/* Pills & badges */

.hp-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--hp-radius-pill);
  font-size: 11px;
  font-weight: 500;
}

.hp-pill--active {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.hp-pill--monitoring {
  background: rgba(234, 179, 8, 0.12);
  color: #92400e;
}

.hp-pill--resolved {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.hp-pill--impact-high {
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
}

.hp-pill--impact-medium {
  background: rgba(234, 179, 8, 0.1);
  color: #92400e;
}

.hp-pill--impact-low {
  background: rgba(22, 163, 74, 0.06);
  color: #15803d;
}

/* Cards */

.hp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.hp-card {
  background: white;
  border-radius: var(--hp-radius-lg);
  padding: 14px 16px;
  box-shadow: var(--hp-shadow-soft);
  border: 1px solid var(--hp-border-subtle);
}

.hp-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.hp-card p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--hp-text-soft);
}

.hp-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--hp-text-soft);
  margin-top: 8px;
}

.hp-card-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* About */

.hp-about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.hp-about-card {
  background: white;
  border-radius: var(--hp-radius-lg);
  padding: 14px 16px;
  box-shadow: var(--hp-shadow-soft);
  border: 1px solid var(--hp-border-subtle);
}

.hp-about-card h3 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 15px;
}

.hp-about-card p,
.hp-about-card li {
  font-size: 13px;
  color: var(--hp-text-soft);
}

/* Modal */

.hp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

.hp-modal-backdrop.active {
  display: flex;
}

.hp-modal {
  background: white;
  max-width: 720px;
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.45);
  padding: 18px 20px 16px;
  position: relative;
}

.hp-modal--narrow {
  max-width: 420px;
}

.hp-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  border: none;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  background: #e5e7eb;
}

.hp-modal-header h2 {
  margin: 8px 0 2px;
  font-size: 18px;
}

.hp-modal-header p,
.hp-modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--hp-text-soft);
}

.hp-modal-body h3 {
  margin-top: 14px;
  font-size: 15px;
}

.hp-timeline {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
  max-height: 230px;
  overflow-y: auto;
}

.hp-timeline-item {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}

.hp-timeline-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--hp-accent);
}

.hp-timeline-item::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  bottom: -10px;
  width: 2px;
  background: #e5e7eb;
}

.hp-timeline-item:last-child::after {
  display: none;
}

.hp-timeline-time {
  font-size: 11px;
  color: var(--hp-text-soft);
}

.hp-timeline-text {
  font-size: 13px;
}

.hp-modal-extra {
  margin-top: 14px;
}

.hp-modal-extra h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.hp-modal-extra ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--hp-text-soft);
}

.hp-modal-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hp-primary-btn {
  border-radius: var(--hp-radius-pill);
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--hp-accent);
  color: white;
  cursor: pointer;
}

.hp-primary-btn--full {
  width: 100%;
}

.hp-primary-btn--ghost {
  background: #e5e7eb;
  color: var(--hp-text);
  padding-inline: 10px;
}

.hp-primary-btn:hover {
  filter: brightness(0.95);
}

.hp-modal-note {
  margin: 0;
  font-size: 11px;
  color: var(--hp-text-soft);
}

.hp-reminder-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.hp-reminder-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hp-reminder-form input,
.hp-reminder-form select {
  border-radius: 10px;
  border: 1px solid var(--hp-border-subtle);
  padding: 8px 10px;
  font-size: 13px;
}

/* Misc */

.hp-hint {
  margin: 8px 4px 0;
  font-size: 11px;
  color: var(--hp-text-soft);
}

/* Footer */

.hp-footer {
  text-align: center;
  font-size: 11px;
  color: var(--hp-text-soft);
  padding: 10px 16px 18px;
}

/* Responsive tweaks */

@media (max-width: 900px) {
  .hp-top-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .hp-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hp-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .hp-filters input[type="search"] {
    flex: 1 1 100%;
  }
}
