/* Flevy BDS — shared styles for contributor site and admin panel.
   Brand palette (matches the Flevy logo): white, black, #0066CC,
   plus light-blue tints and neutral grays that complement them. */

:root {
  --brand-blue: #0066cc;
  --brand-blue-dark: #0052a3;
  --brand-blue-tint: #e8f1fb;   /* pale blue for info surfaces */
  --brand-black: #111111;       /* header / footer ground */
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #5f6a75;
  --border: #dce3ea;
  --success-bg: #e6f6ec; --success-fg: #1d6b3a;
  --error-bg: #fdeaea;   --error-fg: #a02929;
  --info-bg: #e8f1fb;    --info-fg: #0052a3;
  --warn-bg: #fff6e0;    --warn-fg: #8a6116;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }
.main { flex: 1; padding-top: 1.75rem; padding-bottom: 3rem; }
.main-narrow { max-width: 460px; padding-top: 4rem; }

a { color: var(--brand-blue); }
a:hover { color: var(--brand-blue-dark); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; color: var(--brand-black); }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .75rem; color: var(--brand-black); }
p.lead { font-size: 1.1rem; color: var(--muted); max-width: 46rem; margin-left: auto; margin-right: auto; }

/* Header / footer */
.site-header { background: var(--brand-black); color: #fff; }
.admin-header { background: #000; border-bottom: 3px solid var(--brand-blue); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
.brand span { color: #4d94e6; }
.brand em { font-style: normal; font-weight: 400; color: #f3c969; font-size: .95rem; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: #d7dde3; text-decoration: none; font-size: .95rem; }
.nav a:hover { color: #fff; text-decoration: underline; }
.site-footer { background: var(--brand-black); color: #9aa3ac; font-size: .85rem; margin-top: auto; }
.site-footer a { color: #4d94e6; }
.site-footer p { margin: .9rem 0; }

/* Banners & flashes */
.banner-warning { background: var(--warn-bg); color: var(--warn-fg); border-bottom: 1px solid #eedfae; }
.banner-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 1.25rem; flex-wrap: wrap; }
.flash { padding: .65rem 1rem; border-radius: 6px; margin-bottom: .9rem; font-size: .95rem; }
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.flash-error { background: var(--error-bg); color: var(--error-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }

/* Cards & stats */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; border-top: 3px solid var(--brand-blue); }
.stat .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--brand-black); }
.stat .stat-label { color: var(--muted); font-size: .85rem; }

/* Buttons & forms */
.button, button.button {
  display: inline-block; background: var(--brand-blue); color: #fff; border: 0; border-radius: 6px;
  padding: .55rem 1.1rem; font-size: .95rem; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--brand-blue-dark); color: #fff; }
.button-small { padding: .35rem .8rem; font-size: .88rem; }
.button-secondary { background: #eef2f6; color: var(--brand-black); }
.button-secondary:hover { background: #dfe6ed; color: var(--brand-black); }
.button-danger { background: #b74040; }
.button-danger:hover { background: #9a3232; }
.inline-form { display: inline; }
.link-button { background: none; border: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.nav .link-button { color: #d7dde3; font-size: .95rem; }

/* Social sign-in */
.oauth-buttons { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.button-oauth {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: .55rem 1rem; font-size: .95rem; text-decoration: none; font-weight: 600;
}
.button-oauth:hover { background: #f2f6fa; border-color: #b9c8d6; color: var(--text); }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

form .field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
label .optional { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 6px;
  font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b3d1f0; border-color: var(--brand-blue); }
.field-hint { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-row { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.checkbox-row input { margin-top: .3rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .35rem .75rem; }
.checkbox-grid label { font-weight: 400; display: flex; gap: .4rem; align-items: center; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 1.25rem; padding: 1rem 1.25rem; background: var(--card); }
legend { font-weight: 700; color: var(--brand-black); padding: 0 .4rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 8px; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f0f4f8; color: var(--brand-black); font-size: .84rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* Badges */
.badge { display: inline-block; border-radius: 20px; font-size: .76rem; padding: .1rem .6rem; font-weight: 600; white-space: nowrap; }
.badge-active { background: var(--success-bg); color: var(--success-fg); }
.badge-withdrawn { background: #ececec; color: #666; }
.badge-other { background: var(--warn-bg); color: var(--warn-fg); }
.badge-muted { background: #ececec; color: #666; }
.badge-info { background: var(--brand-blue-tint); color: var(--brand-blue-dark); }

/* Detail lists */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .35rem 2rem; margin: 0; }
.detail-grid dt { font-weight: 600; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: .6rem; }
.detail-grid dd { margin: 0; }

/* Hero (public landing) */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.1rem; }
.hero .actions { margin-top: 1.5rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2rem; }
.feature-grid h2 { color: var(--brand-blue); }

/* Filter bars */
.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filter-bar .field { margin: 0; }
.filter-bar label { font-size: .78rem; }
.filter-bar input, .filter-bar select { width: auto; min-width: 9rem; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt-0 { margin-top: 0; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}
