/* ---------- Admin Portal ---------- */

/* 1. dashboard */
.adm-d-in { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.adm-list { display: grid; gap: 0.7rem; margin-top: 1.6rem; }
.adm-list li { display: flex; align-items: center; gap: 0.65rem; font-weight: 500; color: var(--text); }
.adm-list .i { width: 1.15rem; height: 1.15rem; color: var(--orange-600); }

/* a stylised dashboard: real labels, placeholder shapes instead of numbers */
.adm-screen {
  display: grid; grid-template-columns: 150px 1fr; min-height: 380px; border-radius: 20px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.adm-side { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.1rem 0.8rem; background: var(--navy); }
.adm-logo { width: 34px; height: 34px; border-radius: 10px; margin: 0 0 1rem 0.4rem; background: var(--orange); }
.adm-side span:not(.adm-logo) { padding: 0.45rem 0.6rem; border-radius: 8px; font-size: 0.78rem; font-weight: 500; color: #cfd0e6; }
.adm-side span.on { background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 600; }
.adm-main { padding: 1rem 1.1rem; background: var(--bg-soft); display: flex; flex-direction: column; gap: 0.9rem; }
.adm-top { display: flex; align-items: center; justify-content: space-between; }
.adm-search { display: flex; align-items: center; width: 55%; height: 32px; padding-inline: 0.6rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--muted-2); }
.adm-search .i { width: 0.9rem; height: 0.9rem; }
.adm-user { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(145deg, var(--orange), #f8c77f); }
.adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.adm-kpi { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.75rem; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); }
.k-ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--orange-50); color: var(--orange-600); }
.adm-kpi:nth-child(even) .k-ic { background: var(--navy-50); color: var(--navy); }
.k-ic .i { width: 0.95rem; height: 0.95rem; }
.adm-kpi b { font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.adm-kpi i { display: block; width: 60%; height: 10px; border-radius: 6px; background: var(--line); }
.adm-panels { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.6rem; }
.adm-chart { display: flex; align-items: flex-end; gap: 6%; padding: 0.9rem; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); min-height: 150px; }
.adm-chart span { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #5556a8, var(--navy)); }
.adm-chart span:nth-child(3n) { background: linear-gradient(180deg, #f8c77f, var(--orange)); }
.adm-rows { display: flex; flex-direction: column; justify-content: space-around; padding: 0.7rem; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); }
.adm-rows span { display: flex; gap: 0.4rem; align-items: center; }
.adm-rows i { display: block; height: 8px; border-radius: 6px; background: var(--line); }
.adm-rows i:first-child { width: 18px; height: 18px; border-radius: 50%; background: var(--navy-50); }
.adm-rows i:last-child { flex: 1; }
@media (prefers-reduced-motion: no-preference) {
  /* bars grow in once the dashboard scrolls into view */
  .adm-screen.rv.in .adm-chart span { animation: adm-bar 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both; }
}
@keyframes adm-bar { from { height: 0; } }

/* 2. approval pipeline: four connected stages */
.adm-pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; counter-reset: s; }
.adm-pipe li {
  position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; border-radius: 20px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
/* arrow connector between stages */
.adm-pipe li:not(:last-child)::after {
  content: ''; position: absolute; right: -1.05rem; top: 50%; translate: 0 -50%; z-index: 1;
  width: 0.7rem; height: 0.7rem; border-top: 2.5px solid var(--orange); border-right: 2.5px solid var(--orange); rotate: 45deg;
}
.adm-pipe li:last-child { background: var(--navy); border-color: var(--navy); }
.ap-ic { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--orange-50); color: var(--orange-600); }
.ap-ic .i { width: 1.3rem; height: 1.3rem; }
.adm-pipe li:last-child .ap-ic { background: var(--orange); color: #fff; }
.adm-pipe b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 1.08rem; color: var(--navy); }
.adm-pipe li > div > span { display: block; margin-top: 0.25rem; font-size: 0.93rem; line-height: 1.5; color: var(--muted); }
.adm-pipe li:last-child b { color: #fff; }
.adm-pipe li:last-child > div > span { color: #cfd0e6; }
.adm-examples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 2rem; font-size: 0.92rem; color: var(--muted); }
.adm-examples em { font-style: normal; font-weight: 600; padding: 0.35rem 0.8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); }

/* 3. reports + roles */
.adm-g-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.adm-reports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.adm-report {
  display: flex; flex-direction: column; gap: 0.8rem; padding: 1.4rem; border-radius: 20px; background: var(--bg-soft); border: 1px solid var(--line-2);
  transition: background 0.3s ease, box-shadow 0.3s ease, translate 0.3s ease;
}
.adm-report:hover { background: #fff; box-shadow: var(--shadow-md); translate: 0 -3px; }
.r-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; }
.r-ic .i { width: 1.2rem; height: 1.2rem; }
.adm-report b { font-family: var(--f-head); font-weight: 600; font-size: 1.05rem; color: var(--navy); }
.r-doc { display: grid; gap: 5px; }
.r-doc i { display: block; height: 6px; border-radius: 4px; background: var(--line); }
.r-doc i:nth-child(1) { width: 90%; } .r-doc i:nth-child(2) { width: 70%; } .r-doc i:nth-child(3) { width: 45%; background: #fbe0bd; }

.adm-roles { padding: 1.6rem; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.adm-roles h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy); }
.adm-roles h3 .i { width: 1.1rem; height: 1.1rem; color: var(--orange-600); }
.adm-roles ol { margin-top: 1rem; display: grid; gap: 0.5rem; }
.adm-roles li {
  position: relative; display: flex; gap: 0.8rem; align-items: center; padding: 0.7rem 0.9rem; border-radius: 12px; overflow: hidden;
  background: var(--bg-soft);
}
/* access width narrows down the tiers */
.adm-roles li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: linear-gradient(90deg, rgba(255, 152, 0, 0.14), rgba(255, 152, 0, 0)); }
.rn { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; font-family: var(--f-head); font-weight: 700; font-size: 0.8rem; }
.adm-roles li > div { position: relative; }
.adm-roles li b { display: block; font-family: var(--f-head); font-weight: 600; font-size: 0.98rem; color: var(--navy); }
.adm-roles li span:not(.rn) { font-size: 0.86rem; color: var(--muted); }
.adm-assure { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line-2); display: grid; gap: 0.5rem; }
.adm-assure li { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--text); }
.adm-assure .i { width: 1rem; height: 1rem; color: #0f8fb0; }

@media (max-width: 1100px) {
  .adm-d-in, .adm-g-in { grid-template-columns: 1fr; }
  .adm-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-pipe li:nth-child(2)::after { display: none; }
}
@media (max-width: 760px) {
  .adm-screen { grid-template-columns: 1fr; min-height: 0; }
  .adm-side { display: none; }
  .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-panels { grid-template-columns: 1fr; }
  .adm-pipe { grid-template-columns: 1fr; }
  .adm-pipe li::after { display: none; }
  .adm-reports { grid-template-columns: 1fr 1fr; }
}
