/* ==========================================================================
   The Christ-Life Church - brand layer
   Palette sampled from the official brand guide:
     midnight  #01071D      gold  #FFC000 -> #FFCB00
     charcoal  #3C3C3C      white #FFFFFF
   ========================================================================== */

:root {
  --tclc-navy-900: #01071D;
  --tclc-navy-850: #040B26;
  --tclc-navy-800: #071132;
  --tclc-navy-700: #0C1A45;
  --tclc-navy-600: #14265E;
  --tclc-navy-500: #1D3480;

  --tclc-gold-300: #FFE47A;
  --tclc-gold-400: #FFCB00;
  --tclc-gold-500: #FFC000;
  --tclc-gold-600: #F7B101;
  --tclc-gold-glow: rgba(255, 192, 0, .35);

  --tclc-charcoal: #3C3C3C;
  --tclc-ink: #0B1020;

  --tclc-good: #34D399;
  --tclc-warn: #FBBF24;
  --tclc-bad: #F87171;

  --tclc-serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --tclc-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Type scale. Everything sizes from these rather than ad-hoc pixel values,
     so raising readability is one edit rather than forty.
     Small print was the first complaint about this interface: nothing that
     carries meaning now sits below 13px, and muted text is lightened to keep
     contrast well clear of the 4.5:1 floor on the navy. */
  --tclc-fs-micro: 12.5px;   /* eyebrow labels, pills */
  --tclc-fs-small: 13.5px;   /* captions under a figure */
  --tclc-fs-body:  15px;     /* default reading size */
  --tclc-fs-lead:  17.5px;   /* intro paragraphs */
  --tclc-fs-value: 42px;     /* headline figures */

  --tclc-text:       #EEF2FA;  /* primary */
  --tclc-text-muted: #AFBBD8;  /* ~7.4:1 on the navy */
  --tclc-text-dim:   #93A1C4;  /* ~5.6:1, for genuinely secondary text */

  --tclc-radius: 16px;
  --tclc-radius-sm: 10px;

  /* Layered rather than a single blur: gives cards a sense of sitting
     above the page instead of a smudge behind them. */
  --tclc-lift-1: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .25);
  --tclc-lift-2: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --tclc-lift-3: 0 8px 20px rgba(0, 0, 0, .45), 0 30px 60px rgba(0, 0, 0, .45);
}

/* --------------------------------------------------------------------------
   Django admin theming.
   Django 6 drives the whole admin from these variables, so overriding them
   rebrands every page at once rather than fighting selector by selector.
   -------------------------------------------------------------------------- */

html[data-theme="light"], html[data-theme="dark"], :root {
  --primary: var(--tclc-navy-700);
  --secondary: var(--tclc-navy-800);
  --accent: var(--tclc-gold-400);
  --primary-fg: #fff;

  --body-fg: var(--tclc-text);
  --body-bg: var(--tclc-navy-900);
  --body-quiet-color: var(--tclc-text-muted);
  --body-loud-color: #fff;

  --header-color: #fff;
  --header-branding-color: var(--tclc-gold-400);
  --header-bg: linear-gradient(100deg, #01071D 0%, #0C1A45 55%, #14265E 100%);
  --header-link-color: #fff;

  --breadcrumbs-fg: #A9B6D6;
  --breadcrumbs-link-fg: var(--tclc-gold-300);
  --breadcrumbs-bg: rgba(12, 26, 69, .55);

  --link-fg: var(--tclc-gold-400);
  --link-hover-color: var(--tclc-gold-300);
  --link-selected-fg: var(--tclc-gold-500);

  --hairline-color: rgba(255, 255, 255, .08);
  --border-color: rgba(255, 255, 255, .13);

  --error-fg: var(--tclc-bad);
  --message-success-bg: rgba(52, 211, 153, .14);
  --message-warning-bg: rgba(251, 191, 36, .14);
  --message-error-bg: rgba(248, 113, 113, .14);

  --darkened-bg: var(--tclc-navy-850);
  --selected-bg: var(--tclc-navy-800);
  --selected-row: rgba(255, 192, 0, .12);

  --button-fg: #fff;
  --button-bg: var(--tclc-navy-600);
  --button-hover-bg: var(--tclc-navy-500);
  --default-button-bg: var(--tclc-gold-500);
  --default-button-hover-bg: var(--tclc-gold-400);
  --close-button-bg: #3A445F;
  --close-button-hover-bg: #55607F;
  --delete-button-bg: #B4232B;
  --delete-button-hover-bg: #CE2F38;

  --object-tools-bg: var(--tclc-navy-600);
  --object-tools-hover-bg: var(--tclc-gold-600);
  --object-tools-fg: #fff;

  color-scheme: dark;
}

body {
  font-family: var(--tclc-sans);
  font-size: var(--tclc-fs-body);
  line-height: 1.55;
  background: var(--tclc-navy-900);
  position: relative;
}

/* Django's admin sets 13px in a dozen places. Rather than chase each one,
   lift the defaults here and let the specific rules below refine. */
#content, .module, #changelist, .form-row, .help, p, td, th, li, label {
  font-size: inherit;
}
#result_list, #changelist table { font-size: 14.5px; }
.help, .helptext, small { font-size: var(--tclc-fs-small) !important;
  color: var(--tclc-text-dim); }

/* --------------------------------------------------------------------------
   The living background.
   Flat navy reads as dull no matter how good the navy is. Three slow-drifting
   pools of brand colour give it depth, and a fine grain stops the gradients
   banding on cheaper screens. All of it is transform-driven and sits behind
   pointer events, so it costs the compositor and nothing else.
   -------------------------------------------------------------------------- */

.tclc-aura {
  position: fixed;
  inset: -25vmax;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.tclc-aura span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.tclc-aura .a1 {
  width: 58vmax; height: 58vmax; top: -6vmax; left: -8vmax;
  background: radial-gradient(circle, rgba(255,192,0,.30), transparent 68%);
  animation: tclc-drift-a 34s ease-in-out infinite alternate;
}
.tclc-aura .a2 {
  width: 66vmax; height: 66vmax; top: 8vmax; right: -14vmax;
  background: radial-gradient(circle, rgba(41,74,178,.55), transparent 66%);
  animation: tclc-drift-b 42s ease-in-out infinite alternate;
}
.tclc-aura .a3 {
  width: 48vmax; height: 48vmax; bottom: -12vmax; left: 26vmax;
  background: radial-gradient(circle, rgba(120,64,190,.30), transparent 70%);
  animation: tclc-drift-c 52s ease-in-out infinite alternate;
}
@keyframes tclc-drift-a {
  to { transform: translate3d(9vmax, 6vmax, 0) scale(1.14); }
}
@keyframes tclc-drift-b {
  to { transform: translate3d(-11vmax, 8vmax, 0) scale(1.09); }
}
@keyframes tclc-drift-c {
  to { transform: translate3d(7vmax, -9vmax, 0) scale(1.18); }
}

/* Grain. A touch of noise is the difference between "flat dark blue" and
   "deep". Kept very low opacity -- it should be felt, not seen. */
.tclc-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* A soft darkening at the edges keeps attention in the middle of the page. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 35%, transparent 55%, rgba(0,0,0,.55));
}

h1, h2, h3, h4, .tclc-serif {
  font-family: var(--tclc-serif);
  letter-spacing: .1px;
}

/* Header ------------------------------------------------------------------ */

#header {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 192, 0, .22);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  padding: 14px 24px;
}

#branding h1 { font-family: var(--tclc-serif); font-weight: 700; }
#branding h1 a:link, #branding h1 a:visited { color: #fff; }

/* The gold rule under the header echoes the sun-ray motif. */
#header::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--tclc-gold-500), var(--tclc-gold-300), var(--tclc-gold-500), transparent);
  opacity: .8;
}

.tclc-logo { display: flex; align-items: center; gap: 14px; }
.tclc-logo img { height: 38px; width: auto; display: block; }
.tclc-logo .tclc-wordmark { line-height: 1.1; }
.tclc-logo .tclc-wordmark strong {
  font-family: var(--tclc-serif);
  font-size: 17px; color: #fff; display: block; letter-spacing: .3px;
}
.tclc-logo .tclc-wordmark span {
  font-size: 11px; color: var(--tclc-gold-300); letter-spacing: 1.4px;
  text-transform: uppercase;
}

/* Modules, tables, forms -------------------------------------------------- */

.module, .dashboard .module, fieldset.module {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--border-color);
  border-radius: var(--tclc-radius);
  box-shadow: var(--tclc-lift-1);
  overflow: hidden;
}

.module h2, .module caption, .inline-group h2 {
  background: linear-gradient(90deg, var(--tclc-navy-700), var(--tclc-navy-600));
  color: #fff;
  font-family: var(--tclc-serif);
  letter-spacing: .3px;
  border-bottom: 1px solid rgba(255, 192, 0, .25);
}

#result_list thead th {
  background: rgba(255, 255, 255, .04);
  color: var(--tclc-gold-300);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
}
#result_list tbody tr { transition: background .15s ease, transform .15s ease; }
#result_list tbody tr:hover { background: rgba(255, 192, 0, .07); }

input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=tel], textarea, select, .vTextField {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border-color);
  border-radius: var(--tclc-radius-sm);
  color: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus, .vTextField:focus {
  border-color: var(--tclc-gold-500) !important;
  box-shadow: 0 0 0 3px var(--tclc-gold-glow) !important;
  outline: none;
}

.button, input[type=submit], input[type=button], .submit-row input, a.button {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .2px;
  border: 1px solid rgba(255, 255, 255, .12);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover, input[type=submit]:hover, .submit-row input:hover, a.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--tclc-lift-1);
}
.button.default, input[type=submit].default, .submit-row input.default {
  background: linear-gradient(135deg, var(--tclc-gold-600), var(--tclc-gold-400));
  color: var(--tclc-ink);
  border: none;
  box-shadow: 0 6px 18px rgba(255, 192, 0, .28);
}
.button.default:hover, input[type=submit].default:hover {
  box-shadow: 0 10px 26px rgba(255, 192, 0, .42);
}

.messagelist li {
  border-radius: var(--tclc-radius-sm);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(6px);
}

#nav-sidebar, .sticky { background: rgba(4, 11, 38, .72); }
#nav-sidebar a:hover { color: var(--tclc-gold-300); }

/* --------------------------------------------------------------------------
   Dashboard components
   -------------------------------------------------------------------------- */

.tclc-shell { max-width: 1320px; margin: 0 auto; padding: 0 20px 72px; }

/* Hero -------------------------------------------------------------------- */

.tclc-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: center;
  padding: 56px 44px;
  margin: 26px 0 34px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 192, 0, .2);
  background:
    radial-gradient(700px 340px at 88% 20%, rgba(255, 192, 0, .20), transparent 62%),
    linear-gradient(135deg, #050E2E 0%, #10214F 46%, #1B2F72 100%);
  box-shadow: var(--tclc-lift-3);
}

/* A gold seam along the top edge, catching the light like the mark itself. */
.tclc-hero::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(255,203,0,.9) 30%, rgba(255,255,255,.85) 50%,
    rgba(255,203,0,.9) 70%, transparent);
}
/* Slow sheen travelling across the panel. Subtle enough to register as
   depth rather than as an animation demanding attention. */
.tclc-hero::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; width: 40%;
  left: -50%;
  background: linear-gradient(105deg,
    transparent, rgba(255,255,255,.055) 45%, transparent);
  animation: tclc-sheen 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tclc-sheen {
  0%, 62% { left: -50%; }
  100%    { left: 115%; }
}

.tclc-hero h1 {
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.06;
  margin: 0 0 14px;
  color: #fff;
  text-wrap: balance;
}
.tclc-hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--tclc-gold-300), var(--tclc-gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tclc-hero .tclc-verse {
  color: #C7D2EC;
  font-size: var(--tclc-fs-lead);
  max-width: 46ch;
  line-height: 1.62;
}

.tclc-hero-media {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1000px;
}
.tclc-hero-media video {
  width: min(340px, 100%);
  border-radius: 20px;
  /* The animation is on a white field; blending drops the white out so it
     sits on the navy without a hard box around it. */
  mix-blend-mode: screen;
  filter: contrast(1.06) saturate(1.12);
  transform: rotateY(-9deg) rotateX(4deg);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.tclc-hero-media:hover video { transform: rotateY(0deg) rotateX(0deg) scale(1.03); }

/* Sun-ray halo built from the logo motif, rotating slowly in 3D. */
.tclc-rays {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform-style: preserve-3d;
  animation: tclc-spin 42s linear infinite;
}
.tclc-rays i {
  position: absolute;
  width: 3px;
  height: 46px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--tclc-gold-400), transparent);
  transform-origin: 50% 150px;
  opacity: .5;
}
@keyframes tclc-spin { to { transform: rotate(360deg); } }

/* Stat cards -------------------------------------------------------------- */

.tclc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}

.tclc-card {
  position: relative;
  padding: 24px 24px 22px;
  border-radius: var(--tclc-radius);
  border: 1px solid var(--border-color);
  background:
    linear-gradient(165deg, rgba(255,255,255,.085), rgba(255,255,255,.025));
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: var(--tclc-lift-1);
  transform-style: preserve-3d;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
  will-change: transform;
  overflow: hidden;
}
.tclc-card::before {
  /* Light catching the top edge, so the card reads as a physical surface. */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
}
.tclc-card::after {
  /* A glow that tracks the pointer -- the same coordinates that drive the
     tilt, so the highlight and the rotation agree and the surface reads as
     one solid object rather than two effects. */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 192, 0, .16), transparent 62%);
}
.tclc-card:hover::after { opacity: 1; }
.tclc-card:hover {
  box-shadow: var(--tclc-lift-2), 0 0 0 1px rgba(255,192,0,.18);
  border-color: rgba(255, 192, 0, .42);
}
.tclc-card h4 {
  margin: 0 0 10px;
  font-family: var(--tclc-sans);
  font-size: var(--tclc-fs-micro);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tclc-text-muted);
  font-weight: 700;
}
.tclc-value {
  font-family: var(--tclc-serif);
  font-size: var(--tclc-fs-value);
  line-height: 1.02;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}
.tclc-value.good { color: #5EEAD4; }
.tclc-value.warn { color: #FCD34D; }
.tclc-value.bad  { color: #FCA5A5; }
.tclc-sub {
  margin-top: 10px;
  font-size: var(--tclc-fs-small);
  color: var(--tclc-text-muted);
  line-height: 1.5;
}

.tclc-spark { margin-top: 14px; height: 34px; display: block; width: 100%; }

/* Section headings -------------------------------------------------------- */

.tclc-section {
  display: flex; align-items: baseline; gap: 14px;
  margin: 38px 0 16px;
}
.tclc-section h2 {
  margin: 0; font-size: 24px; color: #fff; letter-spacing: .2px;
}
.tclc-section .rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg,
    rgba(255,192,0,.75), rgba(255,192,0,.18) 45%, transparent);
}
.tclc-section a {
  font-size: var(--tclc-fs-small); white-space: nowrap; font-weight: 600;
}

/* 3D bar chart ------------------------------------------------------------ */

.tclc-chart3d {
  --depth: 12px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 220px;
  padding: 26px 26px 12px;
  border-radius: var(--tclc-radius);
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  perspective: 900px;
  overflow-x: auto;
}
.tclc-bar-wrap {
  flex: 1 0 42px;
  /* A definite height, or the bars' percentage heights resolve against an
     auto-height parent and collapse to zero. */
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end;
  gap: 8px;
  transform-style: preserve-3d;
}
.tclc-bar {
  position: relative;
  width: 100%;
  flex: none;
  min-height: 4px;                 /* a quiet week is still visible */
  max-height: calc(100% - 22px);   /* leaves room for the label */
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--tclc-gold-400), var(--tclc-gold-600));
  transform: rotateX(-16deg);
  transform-origin: bottom center;
  transform-style: preserve-3d;
  box-shadow: 0 10px 24px rgba(255, 192, 0, .18);
  animation: tclc-rise .9s cubic-bezier(.2, .8, .2, 1) backwards;
}
.tclc-bar.expense {
  background: linear-gradient(180deg, #6D7BA8, #3B4668);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}
.tclc-bar::after {
  /* The extruded top face -- what makes it read as a solid, not a rectangle. */
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: var(--depth);
  background: linear-gradient(180deg, #FFE9A8, var(--tclc-gold-400));
  transform: rotateX(74deg);
  transform-origin: top center;
  border-radius: 4px;
}
.tclc-bar.expense::after { background: linear-gradient(180deg, #97A3C6, #6D7BA8); }
/* Scale rather than height: height cannot be animated from a percentage
   reliably, and transform animates on the compositor so it stays smooth on
   a phone. */
@keyframes tclc-rise {
  from { transform: rotateX(-16deg) scaleY(0); opacity: .25; }
}
.tclc-bar-label {
  font-size: var(--tclc-fs-micro);
  color: var(--tclc-text-muted);
  letter-spacing: .03em;
  white-space: nowrap;
}

/* Ranked list ------------------------------------------------------------- */

.tclc-list { display: grid; gap: 10px; }
.tclc-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--tclc-radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, .035);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.tclc-row:hover {
  transform: translateX(4px);
  background: rgba(255, 192, 0, .08);
  border-color: rgba(255, 192, 0, .3);
}
.tclc-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 192, 0, .5);
  background: var(--tclc-navy-700);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--tclc-gold-300);
}
.tclc-row .name { color: #fff; font-weight: 650; font-size: 15.5px; }
.tclc-row .meta {
  color: var(--tclc-text-muted);
  font-size: var(--tclc-fs-small);
  margin-top: 3px;
}

.tclc-pill {
  padding: 5px 13px; border-radius: 999px;
  font-size: var(--tclc-fs-micro); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap;
}
.tclc-pill.critical { background: rgba(248,113,113,.18); color: #FCA5A5; }
.tclc-pill.high     { background: rgba(251,146,60,.18);  color: #FDBA74; }
.tclc-pill.watch    { background: rgba(251,191,36,.16);  color: #FCD34D; }
.tclc-pill.low      { background: rgba(52,211,153,.16);  color: #6EE7B7; }
.tclc-pill.gold     { background: rgba(255,192,0,.18);   color: var(--tclc-gold-300); }

/* Quick actions ----------------------------------------------------------- */

.tclc-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tclc-action {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border-radius: var(--tclc-radius);
  border: 1px solid var(--border-color);
  background: linear-gradient(150deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  text-decoration: none;
  transition: transform .16s ease, box-shadow .25s ease, border-color .2s ease;
}
.tclc-action:hover {
  transform: translateY(-3px);
  border-color: rgba(255,192,0,.45);
  box-shadow: var(--tclc-lift-2);
}
.tclc-action .icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--tclc-gold-600), var(--tclc-gold-400));
  color: var(--tclc-ink);
  font-size: 19px;
}
.tclc-action strong {
  color: #fff; display: block; font-size: 15.5px; margin-bottom: 2px;
}
.tclc-action > span > span {
  color: var(--tclc-text-muted); font-size: var(--tclc-fs-small);
}

/* --------------------------------------------------------------------------
   Interactive controls
   -------------------------------------------------------------------------- */

.tclc-controls {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-bottom: 24px;
}

.tclc-find {
  position: relative; flex: 1 1 300px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-color);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.tclc-find:focus-within {
  border-color: var(--tclc-gold-500);
  box-shadow: 0 0 0 3px var(--tclc-gold-glow);
}
.tclc-find input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-size: var(--tclc-fs-body); font-family: var(--tclc-sans);
}
.tclc-find input::placeholder { color: var(--tclc-text-dim); }

.tclc-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(6, 14, 42, .97);
  backdrop-filter: blur(18px);
  box-shadow: var(--tclc-lift-3);
}
.tclc-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; text-decoration: none;
  border-bottom: 1px solid var(--hairline-color);
}
.tclc-result:last-child { border-bottom: none; }
.tclc-result:hover { background: rgba(255,192,0,.1); }
.tclc-result b { color: #fff; display: block; font-size: var(--tclc-fs-body); }
.tclc-result small { color: var(--tclc-text-muted); font-size: var(--tclc-fs-small); }
.tclc-noresult {
  padding: 16px; margin: 0; color: var(--tclc-text-muted);
  font-size: var(--tclc-fs-small);
}

.tclc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tclc-chip {
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  font-size: var(--tclc-fs-small); font-weight: 600;
  color: var(--tclc-text-muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-color);
  transition: all .18s ease;
}
.tclc-chip:hover { color: #fff; border-color: rgba(255,192,0,.45); }
.tclc-chip.active {
  background: linear-gradient(135deg, var(--tclc-gold-600), var(--tclc-gold-400));
  color: var(--tclc-ink); border-color: transparent;
}

.tclc-toggles { display: flex; gap: 10px; flex-wrap: wrap; }
.tclc-seg {
  display: flex; padding: 4px; gap: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-color);
}
.tclc-seg button {
  padding: 7px 15px; border-radius: 999px; cursor: pointer; border: none;
  background: none; color: var(--tclc-text-muted);
  font-size: var(--tclc-fs-small); font-weight: 600;
  transition: all .16s ease;
}
.tclc-seg button:hover { color: #fff; }
.tclc-seg button.active {
  background: var(--tclc-gold-500); color: var(--tclc-ink);
}

.tclc-hint {
  color: var(--tclc-text-dim); font-size: var(--tclc-fs-small);
  margin: -6px 0 14px;
}
.tclc-chart-empty {
  color: var(--tclc-text-muted); margin: auto; text-align: center;
  font-size: var(--tclc-fs-body);
}

/* Rows become buttons once the script is running. */
.tclc-row[data-member] { cursor: pointer; }
.tclc-row[data-member]:focus-visible {
  outline: 2px solid var(--tclc-gold-500); outline-offset: 2px;
}
.tclc-row[aria-expanded="true"] {
  background: rgba(255,192,0,.1);
  border-color: rgba(255,192,0,.45);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}

/* Expanded member panel --------------------------------------------------- */

.tclc-panel {
  border: 1px solid rgba(255,192,0,.32);
  border-top: none;
  border-radius: 0 0 var(--tclc-radius) var(--tclc-radius);
  background: linear-gradient(180deg, rgba(255,192,0,.05), rgba(255,255,255,.02));
  padding: 20px 22px 22px;
  margin-top: -10px; margin-bottom: 10px;
  animation: tclc-open .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes tclc-open { from { opacity: 0; transform: translateY(-8px); } }

.tclc-panel-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 26px;
}
.tclc-panel h4 {
  margin: 0 0 12px; font-family: var(--tclc-sans);
  font-size: var(--tclc-fs-micro); letter-spacing: .09em;
  text-transform: uppercase; color: var(--tclc-gold-300); font-weight: 700;
}
.tclc-panel-loading, .tclc-panel-note {
  color: var(--tclc-text-muted); font-size: var(--tclc-fs-small);
  margin: 10px 0 0;
}
.tclc-panel-list { margin: 0; padding-left: 18px; }
.tclc-panel-list li {
  color: var(--tclc-text-muted); font-size: var(--tclc-fs-small);
  margin-bottom: 5px;
}
.tclc-panel-list b { color: var(--tclc-gold-300); }

.tclc-metric {
  display: grid; grid-template-columns: 108px 1fr 42px;
  align-items: center; gap: 10px; margin-bottom: 8px;
  font-size: var(--tclc-fs-small); color: var(--tclc-text-muted);
}
.tclc-meter {
  height: 7px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.09);
}
.tclc-meter i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--tclc-gold-600), var(--tclc-gold-300));
  animation: tclc-fill .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes tclc-fill { from { width: 0 !important; } }
.tclc-metric em { font-style: normal; text-align: right; color: #fff; }
.tclc-unknown { color: var(--tclc-text-dim); grid-column: 2 / span 2; }

.tclc-warnbox {
  padding: 13px 15px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(248,113,113,.14);
  border: 1px solid rgba(248,113,113,.4);
  color: #FCA5A5; font-size: var(--tclc-fs-small); line-height: 1.5;
}

.tclc-call {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: var(--tclc-fs-body);
  color: var(--tclc-ink);
  background: linear-gradient(135deg, var(--tclc-gold-600), var(--tclc-gold-400));
  box-shadow: 0 6px 18px rgba(255,192,0,.28);
}
.tclc-call:hover { transform: translateY(-1px); }

.tclc-outcomes { display: flex; flex-wrap: wrap; gap: 8px; }
.tclc-outcome {
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  font-size: var(--tclc-fs-small); font-weight: 600;
  color: var(--tclc-text-muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-color);
  transition: all .15s ease;
}
.tclc-outcome:hover:not(:disabled) {
  color: #fff; border-color: rgba(255,192,0,.5);
  background: rgba(255,192,0,.12);
}
/* Outcomes that count as genuine contact are visually distinct from
   "no answer", so the scoring rule is legible in the interface itself. */
.tclc-outcome.reached { border-color: rgba(52,211,153,.34); color: #A7F3D0; }
.tclc-outcome:disabled { opacity: .45; cursor: default; }
.tclc-outcome.saving { background: var(--tclc-gold-500); color: var(--tclc-ink); }

.tclc-note {
  width: 100%; margin-top: 12px; padding: 11px 14px;
  border-radius: 12px; resize: vertical;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-color);
  color: #fff; font-family: var(--tclc-sans);
  font-size: var(--tclc-fs-small);
}

/* Feedback ---------------------------------------------------------------- */

.tclc-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 100;
  transform: translate(-50%, 20px);
  padding: 14px 24px; border-radius: 999px;
  background: rgba(6,14,42,.97);
  border: 1px solid rgba(255,192,0,.45);
  color: #fff; font-size: var(--tclc-fs-body); font-weight: 600;
  box-shadow: var(--tclc-lift-3);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  max-width: calc(100vw - 32px); text-align: center;
}
.tclc-toast.in { opacity: 1; transform: translate(-50%, 0); }
.tclc-toast.bad { border-color: rgba(248,113,113,.6); }

.tclc-flash { animation: tclc-flash .7s ease; }
@keyframes tclc-flash {
  0%   { color: var(--tclc-gold-300); text-shadow: 0 0 26px var(--tclc-gold-glow); }
  100% { }
}

.is-loading .tclc-grid, .is-loading #tclc-chart, .is-loading #tclc-risk {
  opacity: .45; transition: opacity .15s ease; pointer-events: none;
}

.tclc-bar.giving {
  background: linear-gradient(180deg, #6EE7B7, #10B981);
  box-shadow: 0 10px 24px rgba(16,185,129,.2);
}
.tclc-bar.giving::after { background: linear-gradient(180deg, #A7F3D0, #6EE7B7); }

@media (max-width: 700px) {
  .tclc-panel-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* Accessibility and small screens ----------------------------------------- */

@media (max-width: 900px) {
  .tclc-hero { grid-template-columns: 1fr; padding: 34px 22px; text-align: center; }
  .tclc-hero-media { order: -1; }
  .tclc-value { font-size: 28px; }
}

/* Anyone who has asked their system to reduce motion gets a still page --
   the animation is decoration, never the information. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .tclc-hero-media video { transform: none; }
}
