/* ============================================================
   SWF Scorecard — light animated theme in SWF logo colours
   Red #C4161C · Cyan #29ABE2 · Purple #7B2D8E
   ============================================================ */
:root {
  --red: #c4161c;
  --red-dark: #96090f;
  --cyan: #29abe2;
  --cyan-dark: #1785b5;
  --purple: #7b2d8e;
  --ink: #2b2b33;
  --muted: #757a87;
  --bg: #f6f8fb;
  --card: #ffffff;
  --line: #e6e9f0;
  --ok: #2e9e5b;
  --warn: #e8a020;
  --bad: #d23a3a;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(43, 43, 51, .07);
  --shadow-hover: 0 10px 30px rgba(43, 43, 51, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(43,43,51,.05);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--purple), var(--cyan));
  background-size: 200% 100%;
  animation: slideGrad 8s linear infinite;
}
@keyframes slideGrad {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: .3px;
}
.brand img { height: 44px; width: 44px; object-fit: contain; transition: transform .4s; }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand b { color: var(--red); font-weight: 700; }

.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all .25s;
}
.mainnav a:hover { color: var(--red); background: #fdf0f0; }
.mainnav a.on { color: #fff; background: linear-gradient(120deg, var(--red), var(--purple)); box-shadow: 0 4px 12px rgba(196,22,28,.3); }

.userbox { display: flex; align-items: center; gap: 12px; }
.hello { color: var(--muted); font-size: .88rem; }

.adminbar {
  background: linear-gradient(120deg, #fff, #faf6fd);
  border-bottom: 1px solid var(--line);
  padding: 8px 28px;
  display: flex;
  gap: 6px;
}
.adminbar a {
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  transition: all .25s;
}
.adminbar a:hover { color: var(--purple); background: #f4eaf7; }
.adminbar a.on { color: #fff; background: var(--purple); }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; width: 100%; margin: 0 auto; padding: 28px; flex: 1; }
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 28px; color: var(--muted); font-size: .8rem;
  border-top: 1px solid var(--line); background: #fff;
}

h1.page { font-size: 1.7rem; font-weight: 700; margin: 0 0 4px; animation: fadeUp .5s ease both; }
p.sub { color: var(--muted); margin: 0 0 24px; animation: fadeUp .5s .06s ease both; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  0% { transform: scale(.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
  animation: fadeUp .5s ease both;
  transition: box-shadow .3s, transform .3s;
}
.card.hoverable:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card h2 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 600; }

.grid { display: grid; gap: 18px; }
.grid.cols3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid > .card:nth-child(2) { animation-delay: .07s; }
.grid > .card:nth-child(3) { animation-delay: .14s; }
.grid > .card:nth-child(4) { animation-delay: .21s; }

/* stat tiles */
.stat { position: relative; overflow: hidden; }
.stat .num { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat::before {
  content: '';
  position: absolute; top: 0; left: 0; height: 4px; width: 100%;
  background: linear-gradient(90deg, var(--red), var(--purple), var(--cyan));
}
.stat.c-red .num { color: var(--red); }
.stat.c-cyan .num { color: var(--cyan-dark); }
.stat.c-purple .num { color: var(--purple); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 600; font-size: .92rem;
  padding: 10px 20px; border-radius: 999px;
  color: #fff; background: linear-gradient(120deg, var(--red), var(--red-dark));
  box-shadow: 0 4px 14px rgba(196,22,28,.3);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(196,22,28,.4); filter: brightness(1.05); }
.btn:active { transform: none; }
.btn-cyan { background: linear-gradient(120deg, var(--cyan), var(--cyan-dark)); box-shadow: 0 4px 14px rgba(41,171,226,.35); }
.btn-cyan:hover { box-shadow: 0 8px 20px rgba(41,171,226,.45); }
.btn-purple { background: linear-gradient(120deg, var(--purple), #5c1f6b); box-shadow: 0 4px 14px rgba(123,45,142,.35); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--red); color: var(--red); box-shadow: none; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ---------- forms ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: .92rem; color: var(--ink);
  background: #fff; transition: border .25s, box-shadow .25s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(41,171,226,.15);
}
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 10px 0; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th {
  text-align: left; padding: 10px 12px; font-size: .76rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line);
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover { background: #f9fbfe; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl select { min-width: 86px; }
.tbl input[type=text], .tbl input[type=number], .tbl input[type=date] { min-width: 64px; }
.tbl a.rowlink { color: var(--cyan-dark); font-weight: 600; text-decoration: none; }
.tbl a.rowlink:hover { text-decoration: underline; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: .76rem; font-weight: 600;
}
.badge.lvl { background: #eef7ef; color: var(--ok); }
.badge.lvl-good { background: linear-gradient(120deg, var(--ok), #24824a); color: #fff; }
.badge.lvl-bad { background: #fdeaea; color: var(--bad); }
.badge.grey { background: #eff1f5; color: var(--muted); }
.badge.draft { background: #fff5e4; color: var(--warn); }
.badge.complete { background: #eef7ef; color: var(--ok); }
.badge.in_progress { background: #e8f5fc; color: var(--cyan-dark); }
.badge.priority { background: #f4eaf7; color: var(--purple); }
.badge.bonus { background: #e8f5fc; color: var(--cyan-dark); }

/* ---------- flash ---------- */
.flash {
  padding: 13px 18px; border-radius: 12px; margin-bottom: 20px;
  font-weight: 500; animation: pop .35s ease both;
}
.flash-success { background: #eaf7ee; color: #1f7a43; border: 1px solid #bfe6cc; }
.flash-error { background: #fdeaea; color: #a32626; border: 1px solid #f2c6c6; }

/* ---------- progress bars ---------- */
.pbar { background: #edf0f5; border-radius: 999px; height: 10px; overflow: hidden; }
.pbar > i {
  display: block; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(.25,.8,.25,1);
}
.pbar > i.go { transform: scaleX(1); }
.pbar.red > i { background: linear-gradient(90deg, var(--red), var(--purple)); }

/* ---------- score gauge ---------- */
.gauge-wrap { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.gauge { position: relative; width: 190px; height: 190px; animation: pop .6s ease both; }
.gauge svg { transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: #edf0f5; stroke-width: 14; }
.gauge .arc {
  fill: none; stroke: url(#gaugeGrad); stroke-width: 14; stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(.25,.8,.25,1);
}
.gauge .g-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge .g-score { font-size: 2.3rem; font-weight: 800; line-height: 1; }
.gauge .g-max { color: var(--muted); font-size: .8rem; }

.level-chip {
  display: inline-block; padding: 10px 26px; border-radius: 14px;
  font-size: 1.25rem; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--red), var(--purple));
  box-shadow: 0 6px 18px rgba(123,45,142,.35);
  animation: pop .5s .3s ease both;
}
.level-chip.nc { background: linear-gradient(120deg, #8b8b95, #6a6a73); }

/* ---------- element blocks on capture screen ---------- */
.el-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.el-head h2 { margin: 0; }
.el-score { font-weight: 700; color: var(--purple); font-variant-numeric: tabular-nums; }
.submin-warn {
  background: #fdf3e4; border: 1px solid #f3ddb0; color: #935f00;
  padding: 8px 14px; border-radius: 10px; font-size: .84rem; margin-top: 10px;
}

/* ---------- login ---------- */
.login-bg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(41,171,226,.14), transparent 60%),
    radial-gradient(600px 420px at 85% 25%, rgba(123,45,142,.13), transparent 60%),
    radial-gradient(700px 500px at 50% 95%, rgba(196,22,28,.10), transparent 60%),
    var(--bg);
  padding: 30px;
}
.login-card {
  background: #fff; border-radius: 22px; box-shadow: var(--shadow-hover);
  padding: 42px 40px; width: 100%; max-width: 400px; text-align: center;
  animation: pop .5s ease both;
}
.login-card img { width: 110px; animation: floaty 5s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.login-card h1 { font-size: 1.4rem; margin: 12px 0 2px; }
.login-card h1 b { color: var(--red); }
.login-card p { color: var(--muted); font-size: .86rem; margin: 0 0 22px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-card input { text-align: center; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.right { text-align: right; }
.mt { margin-top: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty {
  text-align: center; color: var(--muted); padding: 40px 20px;
}
.empty .big { font-size: 2.4rem; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .wrap { padding: 18px; }
  .hello { display: none; }
}
