@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Mulish:wght@400;500;600;700;800&display=swap");

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #33404F;
  --muted: #8791A0;
  --muted2: #5B6675;
  --muted3: #98A2B0;
  --card-border: #EAEDF3;
  --panel-border: #E7EBF1;
  --red: #E23B32;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }

/* 90% width to match the sibling redesigned apps. */
.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

@keyframes gdFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------- Hero ------------------------------- */
.gd-hero-inner {
  max-width: 90%;
  margin: 0 auto;
  padding: 34px 32px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.gd-hero-copy { padding-bottom: 8px; }
.gd-title {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0 0 6px;
  padding-top: 4px;
}
.gd-url { font-size: 15.5px; color: var(--muted2); }
.gd-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  box-shadow: 0 6px 16px rgba(226, 59, 50, 0.28);
}
.gd-add-btn:hover { background: #D0322A; }

/* ------------------------------- Tabs ------------------------------- */
.gd-tabs {
  background: #fff;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.03);
  margin-top: 14px;
}
.gd-tabs-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 38px; }
.gd-tab {
  appearance: none;
  background: none;
  border: none;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
  padding: 18px 2px;
  margin: 0;
  border-bottom: 3px solid transparent;
}
.gd-tab.active { font-weight: 700; color: var(--ink); border-bottom-color: #E8402A; }

/* ------------------------------- Main ------------------------------- */
.gd-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 24px 32px 56px; }
.gd-panel { animation: gdFadeUp 0.35s ease both; display: flex; flex-direction: column; gap: 28px; }

/* ------------------------------- Notice ------------------------------- */
.gd-notice {
  background: #FFF7ED;
  border: 1px solid #F6D9A8;
  color: #8A5A16;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ------------------------------- Stat cards ------------------------------- */
.gd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.gd-stat {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  padding: 22px;
}
.gd-stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gd-stat-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.gd-stat-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 30px; color: var(--ink); line-height: 1; letter-spacing: -0.5px; }
.gd-stat-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.gd-stat-foot { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.gd-delta { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 12px; border-radius: 7px; padding: 3px 8px; }
.gd-delta.up { color: #1FA97A; background: #E7F7F1; border: 1px solid #CDEDE1; }
.gd-delta.down { color: #D14545; background: #FCECEC; border: 1px solid #F5D5D5; }
.gd-stat-note { font-size: 12.5px; color: var(--muted3); }
.gd-stat-track { flex: 1; height: 8px; border-radius: 999px; background: #E7ECF2; overflow: hidden; }
.gd-stat-track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3FB27A, #28BFC0); }
.gd-stat-pct { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px; color: var(--ink); }

/* ------------------------------- Checks & Requests card ------------------------------- */
.gd-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: 0 4px 20px rgba(18, 38, 63, 0.05);
  padding: 28px 28px 30px;
}
.gd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.gd-card-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); margin: 0; }
.gd-card-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gd-periods { display: inline-flex; background: #F1F4F9; border: 1px solid #E5E9F0; border-radius: 11px; padding: 4px; gap: 3px; }
.gd-period {
  appearance: none;
  border: none;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted2);
}
.gd-period.active { background: #2F6FE0; color: #fff; }
.gd-btn-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 11px;
  padding: 11px 20px;
  box-shadow: 0 6px 16px rgba(226, 59, 50, 0.26);
}
.gd-btn-red:hover { background: #D0322A; }

.gd-live-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); margin: 0 0 18px; }
.gd-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }

/* line chart */
.gd-chart-col { min-width: 0; }
.gd-chart-wrap { position: relative; width: 100%; height: 300px; }
.gd-chart-empty { padding: 90px 20px; text-align: center; color: var(--muted); font-size: 14.5px; }
.gd-legend { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.gd-legend-item { display: flex; align-items: center; gap: 8px; }
.gd-legend-dot { width: 11px; height: 11px; border-radius: 50%; }
.gd-legend-name { font-size: 13.5px; color: var(--muted2); font-weight: 600; }

/* donut */
.gd-donut-col { border-left: 1px solid #EEF1F6; padding-left: 28px; }
.gd-donut-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.gd-donut-head-title { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 20px; color: var(--ink); }
.gd-donut-pill { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 12px; color: #D14545; background: #FCECEC; border: 1px solid #F5D5D5; border-radius: 999px; padding: 3px 9px; }
.gd-donut-sub { font-size: 12px; color: var(--muted3); }
.gd-donut { position: relative; width: 200px; height: 200px; margin: 0 auto 20px; }
.gd-donut-ring { width: 100%; height: 100%; border-radius: 50%; }
.gd-donut-hole { position: absolute; inset: 26px; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gd-donut-hole-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.gd-donut-hole-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 30px; color: var(--ink); letter-spacing: -0.5px; }
.gd-sev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.gd-sev { text-align: center; }
.gd-sev-top { display: flex; align-items: center; justify-content: center; gap: 6px; }
.gd-sev-dot { width: 10px; height: 10px; border-radius: 3px; }
.gd-sev-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.gd-sev-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 18px; color: var(--ink); margin-top: 5px; }
.gd-fixed { background: #EAF7EF; border: 1px solid #C4E4CF; border-radius: 11px; padding: 11px; text-align: center; font-size: 14px; color: #2C6B45; font-weight: 600; margin-bottom: 14px; }
.gd-fixed strong { font-weight: 800; color: #1F8A5B; }
.gd-btn-red.full { width: 100%; padding: 13px; font-size: 15px; }

/* ------------------------------- Integrations ------------------------------- */
.gd-int-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.gd-int-count { font-size: 14px; color: var(--muted); font-weight: 600; }
.gd-int-actions { display: flex; align-items: center; gap: 20px; }
.gd-int-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
}
.gd-int-action.grey { color: var(--muted2); }
.gd-int-action.blue { color: #2F6FE0; }

.gd-create {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 14px;
  align-items: end;
}
.gd-create label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted2); }
.gd-create input, .gd-create select {
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid #DCE1E9;
  border-radius: 10px;
  background: #fff;
}
.gd-create .gd-btn-red { padding: 11px 18px; }
.gd-secondary {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted2);
  background: #fff;
  border: 1px solid #DCE1E9;
  border-radius: 10px;
  padding: 11px 18px;
}

.gd-int-list {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  overflow: hidden;
}
.gd-int-row { display: flex; align-items: center; gap: 20px; padding: 20px 26px; border-bottom: 1px solid #F1F4F8; flex-wrap: wrap; }
.gd-int-row:last-child { border-bottom: none; }
.gd-int-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.gd-int-info { flex: 1; min-width: 180px; }
.gd-int-name { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.gd-int-created { font-size: 12.5px; color: var(--muted3); margin-top: 2px; }
.gd-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  background: #E7F7F1;
  border: 1px solid #CDEDE1;
  color: #1F8A5B;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 999px;
}
.gd-status.idle { background: #F2F4F8; border-color: #E3E8EF; color: #7A8798; }
.gd-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #1FA97A; }
.gd-status.idle .gd-status-dot { background: #AAB4C1; }
.gd-int-req { flex: 0 0 auto; width: 90px; text-align: right; }
.gd-int-req-label { font-size: 11.5px; color: var(--muted3); font-weight: 600; }
.gd-int-req-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 22px; color: var(--ink); line-height: 1; margin-top: 3px; }
.gd-int-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid #DCE1E9;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
}
.gd-int-btn.copy { font-family: "Mulish", sans-serif; font-weight: 600; color: var(--muted2); }
.gd-int-btn.more { font-family: "Poppins", sans-serif; font-weight: 700; color: var(--ink); }
.gd-int-btn:hover { border-color: var(--ink); }
.gd-int-btn.copied { color: #1F8A5B; border-color: #CDEDE1; background: #E7F7F1; }

/* detail (More info) */
.gd-detail { flex-basis: 100%; border-top: 1px dashed #E3E8EF; margin-top: 4px; padding-top: 18px; }
.gd-detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 14px; }
.gd-detail-list dt { color: var(--muted); font-weight: 600; }
.gd-detail-list dd { margin: 0; color: var(--ink); }
.gd-detail-list code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: #EEF1F6; padding: 2px 6px; border-radius: 6px; }
.gd-embed { background: #16273F; color: #E7ECF3; border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-all; }
.gd-detail-sub { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px; color: var(--ink); margin: 0 0 8px; }
.gd-hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.gd-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; color: var(--ink); }
.gd-steps li { margin: 3px 0; }
.gd-steps code, .gd-detail-list code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; background: #EEF1F6; padding: 2px 6px; border-radius: 6px; }

/* Google Drive create-form config */
.gd-drive-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 14px;
  padding: 12px;
  margin: 4px 0;
  background: #F5F7FB;
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.gd-drive-fields[hidden] { display: none; }
.gd-drive-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.gd-drive-check input { width: auto; }

/* Recent remediations list */
.gd-remediations { margin: 0 0 12px; }
.gd-rem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gd-rem-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  font-size: 13px;
}
.gd-rem-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-rem-status { font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.gd-rem-remediated .gd-rem-status { color: #1F8A5B; }
.gd-rem-failed .gd-rem-status { color: #C0392B; }
.gd-rem-requested .gd-rem-status { color: #B5772E; }
.gd-rem-date { color: var(--muted); font-size: 12px; }

.gd-empty {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05);
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ------------------------------- Responsive ------------------------------- */
@media (max-width: 1080px) {
  .gd-stats { grid-template-columns: repeat(2, 1fr); }
  .gd-chart-grid { grid-template-columns: 1fr; }
  .gd-donut-col { border-left: none; padding-left: 0; border-top: 1px solid #EEF1F6; padding-top: 24px; }
  .gd-create { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .gd-hero-inner, .gd-tabs-inner, .gd-main { padding-left: 20px; padding-right: 20px; }
  .gd-stats { grid-template-columns: 1fr; }
  .gd-int-row { flex-wrap: wrap; }
  .gd-create { grid-template-columns: 1fr; }
}
