@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;
  --red: #E8402A;
}

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; }

.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

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

/* ------------------------------- Hero ------------------------------- */
.au-hero-inner {
  max-width: 90%; margin: 0 auto; padding: 32px 32px 8px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.au-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;
}
.au-subtitle { font-size: 15.5px; color: var(--muted); }
.au-new-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: 12px; padding: 13px 22px;
  box-shadow: 0 6px 16px rgba(232, 64, 42, 0.28);
}
.au-new-btn:hover { background: #D0322A; }

/* ------------------------------- Main / table ------------------------------- */
.au-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 26px 32px 56px; }
.au-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: 20px;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.05); overflow: hidden; animation: auFadeUp 0.4s ease both;
}
.au-scroll { overflow-x: auto; }
.au-table { border-collapse: collapse; width: 100%; min-width: 900px; }

.au-table thead tr { background: #F8FAFD; border-bottom: 1px solid var(--card-border); }
.au-table th {
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted);
}
.au-th-date { text-align: left; padding: 16px 24px; }
.au-th-center { text-align: center; padding: 16px 18px; }
.au-th-actions { text-align: right; padding: 16px 24px; }

.au-table tbody tr { border-bottom: 1px solid #F1F4F8; }
.au-table tbody tr:last-child { border-bottom: none; }
.au-table td { padding-top: 18px; padding-bottom: 18px; }

.au-td-date { padding-left: 24px; padding-right: 18px; }
.au-date { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15.5px; color: var(--ink); }
.au-time { font-size: 12.5px; color: var(--muted3); margin-top: 2px; }
.au-td-center { text-align: center; padding-left: 18px; padding-right: 18px; }
.au-td-actions { text-align: right; padding-left: 18px; padding-right: 24px; }

.au-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px;
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 14px;
  border-radius: 999px; padding: 5px 12px;
}
.au-pill.pass { color: #1F8A5B; background: #E7F7F1; border: 1px solid #CDEDE1; }
.au-pill.fail { color: #D14545; background: #FCECEC; border: 1px solid #F5D5D5; }
.au-pill.neutral { color: #5B6675; background: #EEF1F6; border: 1px solid #E0E5EE; }

.au-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
}
.au-badge.done { background: #1F8A5B; }
.au-badge.notdone { background: #D14545; }

.au-view {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1.5px solid #DCE1E9; border-radius: 10px; padding: 9px 18px;
}
.au-view:hover { border-color: var(--ink); }

.au-empty { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 15px; }

@media (max-width: 640px) {
  .au-hero-inner, .au-main { padding-left: 20px; padding-right: 20px; }
}

/* ============================================================
   Audit Detail — tabbed check workspace (audit.html)
   ============================================================ */
.ad-hero-inner { max-width: 90%; margin: 0 auto; padding: 28px 32px 4px; }
.ad-back {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--muted); margin-bottom: 16px;
}
.ad-back:hover { color: var(--ink); }
.ad-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ad-head-copy { min-width: 0; }
.ad-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 34px; line-height: 1.08; letter-spacing: -0.5px; color: var(--ink); margin: 0 0 6px; }
.ad-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14.5px; color: var(--muted); }
.ad-meta-dot { width: 4px; height: 4px; border-radius: 50%; background: #C7CEDA; }
.ad-pills { display: flex; align-items: center; gap: 10px; }
.ad-pill { display: inline-flex; align-items: center; gap: 7px; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 999px; }
.ad-pill.pass { background: #E7F7F1; border: 1px solid #CDEDE1; color: #1F8A5B; }
.ad-pill.fail { background: #FCECEC; border: 1px solid #F5D5D5; color: #D14545; }

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

/* main + toolbar */
.ad-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 30px 32px 56px; }
.ad-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.ad-section-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); margin: 0 0 3px; }
.ad-section-sub { font-size: 14px; color: var(--muted); }
.ad-levels { display: inline-flex; gap: 10px; }
.ad-level {
  display: inline-flex; align-items: center; border: 1.5px solid #DCE1E9; background: #fff; color: var(--ink);
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: 13.5px; padding: 10px 18px; border-radius: 10px;
}
.ad-level.active { background: #16273F; color: #fff; border-color: #16273F; box-shadow: 0 2px 6px rgba(22, 39, 63, 0.2); }

/* cards */
.ad-cards { display: flex; flex-direction: column; gap: 16px; animation: auFadeUp 0.35s ease both; }
.ad-card { background: #fff; border: 1px solid var(--card-border); border-radius: 16px; box-shadow: 0 3px 12px rgba(18, 38, 63, 0.045); padding: 22px 24px; }
.ad-card-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ad-card-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); margin: 0; }
.ad-level-badge {
  display: inline-flex; align-items: center; font-family: "Poppins", sans-serif; font-weight: 600; font-size: 11px;
  color: #5B6675; background: #EEF1F6; border: 1px solid #E0E5EE; border-radius: 6px; padding: 3px 8px;
  letter-spacing: 0.2px; transform: translateY(1px);
}
.ad-card-desc { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted2); max-width: 960px; }
.ad-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 18px; }
.ad-results-label { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted3); margin-bottom: 10px; }
.ad-radios { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ad-radio { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; padding: 0; }
.ad-ring { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #C7CEDA; display: flex; align-items: center; justify-content: center; transition: border-color .12s ease; }
.ad-dot-inner { width: 9px; height: 9px; border-radius: 50%; background: transparent; transition: background .12s ease; }
.ad-radio-label { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 14px; color: var(--muted2); }
.ad-radio.is-sel.val-passed .ad-ring { border-color: #1F8A5B; }
.ad-radio.is-sel.val-passed .ad-dot-inner { background: #1F8A5B; }
.ad-radio.is-sel.val-passed .ad-radio-label { color: #1F8A5B; font-weight: 700; }
.ad-radio.is-sel.val-failed .ad-ring { border-color: #D14545; }
.ad-radio.is-sel.val-failed .ad-dot-inner { background: #D14545; }
.ad-radio.is-sel.val-failed .ad-radio-label { color: #D14545; font-weight: 700; }
.ad-radio.is-sel.val-na .ad-ring { border-color: #5B6675; }
.ad-radio.is-sel.val-na .ad-dot-inner { background: #5B6675; }
.ad-radio.is-sel.val-na .ad-radio-label { color: #5B6675; font-weight: 700; }
.ad-add {
  display: inline-flex; align-items: center; gap: 8px; font-family: "Poppins", sans-serif; font-weight: 600;
  font-size: 13.5px; color: var(--ink); background: #fff; border: 1.5px solid #DCE1E9; border-radius: 10px; padding: 10px 18px;
}
.ad-add:hover { border-color: var(--ink); }

@media (max-width: 640px) {
  .ad-hero-inner, .ad-tabs-inner, .ad-main { padding-left: 20px; padding-right: 20px; }
}
