/* ===========================================================
   Codediv Outreach
   Swap the --accent values below for your exact brand colours.
   =========================================================== */

:root {
  --accent:        #1f5fff;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(31, 95, 255, .10);
  --accent-line:   rgba(31, 95, 255, .32);

  --good:          #0f9d6e;
  --good-soft:     rgba(15, 157, 110, .12);
  --warn:          #b4740b;
  --warn-soft:     rgba(180, 116, 11, .12);
  --bad:           #d93a45;
  --bad-soft:      rgba(217, 58, 69, .10);

  --bg:            #f4f6fa;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --border:        #e3e8f0;
  --border-strong: #cfd7e4;
  --text:          #121823;
  --text-2:        #4d5a6e;
  --muted:         #6b7a93;

  --radius:        14px;
  --radius-sm:     9px;
  --shadow:        0 1px 2px rgba(18, 24, 35, .05), 0 8px 24px -16px rgba(18, 24, 35, .18);
  --shadow-lg:     0 24px 60px -24px rgba(18, 24, 35, .28);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --accent-soft:   rgba(84, 140, 255, .14);
  --accent-line:   rgba(84, 140, 255, .38);
  --accent:        #548cff;

  --good:          #2cc38c;
  --good-soft:     rgba(44, 195, 140, .14);
  --warn:          #e9a73c;
  --warn-soft:     rgba(233, 167, 60, .14);
  --bad:           #ff6b70;
  --bad-soft:      rgba(255, 107, 112, .13);

  --bg:            #0a0e16;
  --surface:       #121926;
  --surface-2:     #172031;
  --border:        #243044;
  --border-strong: #32415c;
  --text:          #e9eef7;
  --text-2:        #b6c2d6;
  --muted:         #8a99b3;
  --shadow:        0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -18px rgba(0, 0, 0, .7);
  --shadow-lg:     0 30px 70px -30px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 26px; padding-bottom: 60px; }
.narrow { max-width: 560px; }
.inline { display: inline; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .85em; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 34px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 62px; }

.brand { display: flex; align-items: baseline; gap: 8px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: .95rem; align-self: center;
}
.brand-text { font-weight: 750; letter-spacing: -.03em; font-size: 1.08rem; }
.brand-sub {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 650;
}

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-link {
  padding: 7px 13px; border-radius: 999px; color: var(--text-2);
  font-size: .9rem; font-weight: 550; white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.who {
  font-size: .85rem; color: var(--muted); font-weight: 550;
  padding-left: 10px; border-left: 1px solid var(--border);
}

.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: filter .12s ease, transform .06s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-lg { padding: 12px 22px; font-size: .95rem; }
.btn-block { width: 100%; }

.btn-secondary {
  background: var(--surface); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); filter: none; }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); filter: none; }

.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); filter: none; }

.btn-good { background: var(--good); border-color: var(--good); color: #fff; }

/* ---------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { margin-right: auto; }

/* ---------------------------------------------------------- page head */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .grow { margin-right: auto; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.eyebrow {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent); font-weight: 700; margin-bottom: 4px;
}

/* ---------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 650;
}
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; }
.stat-note { font-size: .78rem; color: var(--muted); }
.stat-value.accent { color: var(--accent); }
.stat-value.good { color: var(--good); }

/* ---------------------------------------------------------- progress */
.progress-wrap { display: flex; align-items: center; gap: 14px; }
.progress {
  flex: 1; height: 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--good));
  border-radius: 999px; transition: width .35s ease;
}
.progress-text { font-size: .85rem; font-weight: 650; color: var(--text-2); white-space: nowrap; }

/* ---------------------------------------------------------- task list */
.tasks { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.task {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); transition: opacity .25s ease, transform .25s ease, border-color .15s ease;
}
.task:hover { border-color: var(--border-strong); }
.task.is-priority { border-left: 3px solid var(--warn); }
.task.is-going { opacity: 0; transform: translateX(26px); }

.task-check { padding-top: 2px; }
.check {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; border-radius: 7px;
  border: 2px solid var(--border-strong); background: var(--surface);
  cursor: pointer; display: grid; place-items: center; flex: none;
  transition: background .12s ease, border-color .12s ease;
}
.check:hover { border-color: var(--accent); }
.check:checked { background: var(--good); border-color: var(--good); }
.check:checked::after {
  content: ""; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px);
}
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}

.task-body { flex: 1; min-width: 0; }
.task-name { font-weight: 650; font-size: .98rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-meta { color: var(--muted); font-size: .85rem; margin-top: 1px; }
.task-meta b { color: var(--text-2); font-weight: 600; }
.task-extra { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.task-note {
  margin-top: 8px; font-size: .84rem; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px; white-space: pre-wrap;
}

.task-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.task-done { opacity: .72; }
.task-done .task-name { text-decoration: line-through; text-decoration-color: var(--muted); }

/* ---------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.pill-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.pill-blue  { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pill-green { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.pill-amber { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.pill-red   { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* ---------------------------------------------------------- forms */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--text-2); }
.field { margin-bottom: 16px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; font-weight: 400; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; }

input[type=file] {
  width: 100%; padding: 10px; font: inherit; font-size: .9rem;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.row-tight { gap: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.switch-row { display: flex; align-items: center; gap: 10px; }
.switch-row label { margin: 0; }

/* ---------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .cell-name { font-weight: 600; }
table.data .cell-actions { white-space: nowrap; text-align: right; }

/* ---------------------------------------------------------- flash / toast */
.flash {
  margin-top: 16px; padding: 11px 15px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 550; border: 1px solid;
}
.flash-ok   { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.flash-err  { background: var(--bad-soft);  border-color: var(--bad);  color: var(--bad); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 90; max-width: 90vw;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- empty state */
.empty { text-align: center; padding: 50px 24px; }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty h3 { margin-bottom: 5px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 420px; font-size: .9rem; }

/* ---------------------------------------------------------- login */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 20px;
  background:
    radial-gradient(900px 500px at 15% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, var(--good-soft), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 30px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; }
.auth-brand .brand-text { font-size: 1.22rem; }
.auth-card h1 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: .88rem; margin: 0 0 22px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: .78rem; color: var(--muted); }

.err-list { margin: 0 0 16px; padding: 11px 15px 11px 32px; border-radius: var(--radius-sm);
  background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); font-size: .87rem; }
.err-list li { margin: 2px 0; }

/* ---------------------------------------------------------- import steps */
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: .83rem; font-weight: 600; color: var(--muted);
}
.step.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.step.is-done { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.step-num {
  width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  background: var(--muted); color: var(--surface); font-size: .68rem; font-weight: 800;
  line-height: 1;
}
.step.is-on .step-num { background: var(--accent); }
.step.is-done .step-num { background: var(--good); }
.step-arrow { color: var(--border-strong); }

.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.map-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.map-item label { display: flex; align-items: center; gap: 6px; }
.map-item .req { color: var(--bad); }
.map-item select { background: var(--surface); }

.preview-table { font-size: .8rem; }
.preview-table th, .preview-table td {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------------------------------------------------- bars (mini chart) */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin-top: 10px; }
.spark-bar {
  flex: 1; min-width: 4px; border-radius: 3px 3px 0 0;
  background: var(--accent-soft); border-bottom: 2px solid var(--accent);
  position: relative;
}
.spark-bar.is-today { background: var(--accent); }

/* ---------------------------------------------------------- misc */
/* utility classes, so markup stays free of ad-hoc inline styles */
.card-head-bare { border: 0; padding-left: 0; padding-right: 0; }
.f-fixed { flex: 0 0 auto; min-width: 0; }
.pad-y { padding: 18px 0; }
.w-md { width: 260px; display: inline-block; }
.max-sm { max-width: 190px; }
.flush { margin-top: 0; margin-bottom: 16px; }
.steps-list { padding-left: 20px; line-height: 1.9; color: var(--text-2); }

.divider { height: 1px; background: var(--border); margin: 22px 0; border: 0; }
.foot { border-top: 1px solid var(--border); background: var(--surface); }
.foot-inner { display: flex; gap: 8px; align-items: center; justify-content: center;
  padding: 18px 20px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.dot { opacity: .5; }

.danger-zone { border-color: var(--bad); }
.danger-zone .card-head { border-bottom-color: var(--bad); }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.pager .is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pager span.off { opacity: .45; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .f-grow { flex: 1; min-width: 190px; }
.filters label { font-size: .75rem; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; }
  .topbar-right { margin-left: auto; }
  .who { display: none; }
  h1 { font-size: 1.35rem; }
  .task { flex-wrap: wrap; }
  .task-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
