/* IITA Members — internal tool styling
   Brand: navy surface, light canvas, five-colour puzzle stripe as signature. */

:root {
  --navy:      #1A2B44;
  --navy-700:  #24375a;
  --canvas:    #F4F6F9;
  --surface:   #FFFFFF;
  --ink:       #1f2933;
  --muted:     #64748b;
  --line:      #e3e8ef;
  --good:      #2EA84F;
  --warn:      #b54708;
  --bad:       #c0392b;
  --accent:    #2A6FDB;
  /* puzzle palette */
  --p-red:    #E23B3B;
  --p-yellow: #F2B705;
  --p-green:  #2EA84F;
  --p-blue:   #2A6FDB;
  --p-black:  #1a1a1a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* puzzle stripe — the signature device */
.puzzle-stripe {
  height: 5px;
  display: flex;
}
.puzzle-stripe span { flex: 1; }
.puzzle-stripe span:nth-child(1) { background: var(--p-red); }
.puzzle-stripe span:nth-child(2) { background: var(--p-yellow); }
.puzzle-stripe span:nth-child(3) { background: var(--p-green); }
.puzzle-stripe span:nth-child(4) { background: var(--p-blue); }
.puzzle-stripe span:nth-child(5) { background: var(--p-black); }

/* top bar */
header.topbar {
  background: var(--navy);
  color: #fff;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 600;
  letter-spacing: .2px;
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand small { font-weight: 400; opacity: .65; font-size: .72rem; }
nav.main { display: flex; gap: 6px; margin-left: 8px; flex-wrap: wrap; }
nav.main a {
  color: #cdd6e4;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .92rem;
}
nav.main a:hover { background: var(--navy-700); color: #fff; text-decoration: none; }
nav.main a.active { background: #fff; color: var(--navy); }
.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .85rem;
  color: #cdd6e4;
}
.topbar-user .who { text-align: right; line-height: 1.25; }
.topbar-user .who strong { color: #fff; display: block; font-weight: 500; }
.role-chip {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.3);
}
.role-chip.admin { background: var(--p-yellow); color: #3a2c00; border-color: transparent; }

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

h1 { font-size: 1.5rem; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 0 0 14px; font-weight: 600; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: .92rem; }

.flash {
  background: #ecfdf3; border: 1px solid #abefc6; color: #067647;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: .92rem;
}

/* stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat .label { color: var(--muted); font-size: .8rem; margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }
.stat.accent { border-top: 3px solid var(--p-green); }

/* panels + bar charts */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
@media (max-width: 760px) { .panel-grid { grid-template-columns: 1fr; } }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .9rem; }
.bar-row .name { width: 38%; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { flex: 1; background: #eef2f7; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--navy); border-radius: 6px; }
.bar-row .val { width: 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-note { color: var(--muted); font-size: .9rem; }

/* tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { padding: 11px 14px; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--line); }
table.data th { background: #f8fafc; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fbfcfe; }
.pill { font-size: .72rem; padding: 2px 9px; border-radius: 99px; font-weight: 500; }
.pill.active { background: #ecfdf3; color: #067647; }
.pill.inactive { background: #f2f4f7; color: #667085; }

/* forms */
form.card, .card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 640px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 500; margin-bottom: 5px; color: var(--ink); }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; border: none; cursor: pointer; font: inherit; font-weight: 500;
  padding: 9px 18px; border-radius: 8px; background: var(--navy); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--navy-700); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #f8fafc; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 5px 12px; font-size: .85rem; }

.link-danger { color: var(--bad); font-size: .85rem; }

footer.foot { max-width: 1100px; margin: 0 auto; padding: 20px; color: var(--muted); font-size: .8rem; text-align: center; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .card { padding: 28px; }
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .crest { font-size: 1.3rem; font-weight: 600; color: var(--navy); }
.login-head .sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.error { background: #fef3f2; border: 1px solid #fecdc9; color: var(--bad); padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 16px; }

/* ---- Site navigation bar (link back to the main website) ---- */
.sitenav { background: var(--navy-700); }
.sitenav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.sitenav a, .sitenav-here {
  color: #cdd8ea; font-size: .72rem; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; padding: 8px 10px; white-space: nowrap; text-decoration: none;
}
.sitenav a:hover { color: #F2B705; text-decoration: none; }
.sitenav-here { color: #F2B705; box-shadow: inset 0 -2px 0 #F2B705; margin-left: auto; }

/* ---- My account page ---- */
.page-head h1 { margin: 22px 0 6px; font-size: 1.4rem; }
.card label { display: block; font-size: .82rem; font-weight: 500; margin: 14px 0 5px; color: var(--ink); }
.muted { color: var(--muted); font-size: .88rem; }
