/* ===========================================================================
   "Financial Stability" palette - navy #0A3C6E, white #FFFFFF, blue #1783C1,
   charcoal #333333. Loaded last: it re-points the CRM primitives in
   styles.css (warm greys -> cool greys, cream -> pale blue, coral -> blue), so
   every component follows without being touched. Danger stays red on purpose,
   now clearly apart from the blue primary.
   =========================================================================== */

:root {
  --navy: #0A3C6E;
  --navy-900: #072c52;
  --sky: #1783C1;

  --warm-25: #fbfcfd;
  --warm-50: #f6f8fb;
  --warm-100: #eef2f6;
  --warm-150: #e5eaf0;
  --warm-200: #dbe2ea;
  --warm-300: #c5cfdb;
  --warm-400: #98a4b3;
  --warm-500: #5d6875;   /* 5.6:1 on white */
  --warm-600: #4a5461;
  --warm-700: #3b434d;
  --warm-800: #2b3038;
  --warm-900: #333333;

  --cream-50: #f8fafd;
  --cream-100: #eef3f9;
  --cream-200: #e5edf6;
  --cream-300: #d2e0ee;
  --cream-400: #b4c9de;

  --coral-50: #e8f3fa;
  --coral-100: #cfe6f4;
  --coral-200: #9fcdea;
  --coral-400: #3a9bd2;
  --coral-500: #1783C1;
  --coral-600: #11669b;
  --coral-700: #0A3C6E;

  --canvas: #f2f5f8;
  --ink: #333333;

  --chart-spend: #1783C1;
  --chart-person: #0A3C6E;

  --shadow-card: 0 1px 2px rgb(10 60 110 / 0.05), 0 8px 22px -8px rgb(10 60 110 / 0.14);
  --shadow-raised: 0 2px 6px rgb(10 60 110 / 0.06), 0 18px 38px -12px rgb(10 60 110 / 0.22);
  --shadow-pop: 0 6px 14px -2px rgb(10 60 110 / 0.10), 0 34px 66px -20px rgb(10 60 110 / 0.34);
  --shadow-tint-coral: 0 10px 26px -10px rgb(23 131 193 / 0.5);
}

body::before {
  background:
    radial-gradient(60rem 44rem at 6% -12%, rgb(23 131 193 / 0.08), transparent 60%),
    radial-gradient(54rem 40rem at 98% 4%, rgb(10 60 110 / 0.06), transparent 62%),
    radial-gradient(50rem 38rem at 78% 110%, rgb(23 131 193 / 0.06), transparent 60%);
}

.modal-back { background: rgb(7 44 82 / 0.42); backdrop-filter: blur(2px); }

/* Primary: blue into navy. */
.btn-primary, .fab, .tile-accent {
  background: linear-gradient(140deg, var(--sky), var(--navy));
}
.btn-primary:hover { box-shadow: 0 14px 32px -10px rgb(23 131 193 / 0.6), var(--shadow-inset-top); }
.tile-accent { box-shadow: 0 16px 34px -14px rgb(10 60 110 / 0.55), var(--shadow-inset-top); }

/* ------------------------------------------------------- navy sidebar == */

.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff;
}
.brand-mark {
  background: linear-gradient(140deg, #3a9bd2, var(--sky));
  box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.5), var(--shadow-inset-top);
}
.brand-text strong { color: #fff; }
.brand-text span { color: rgb(255 255 255 / 0.62); }
.nav-section { color: rgb(255 255 255 / 0.5); }
.nav-link { color: rgb(255 255 255 / 0.84); }
.nav-link:hover { background: rgb(255 255 255 / 0.10); color: #fff; }
.nav-link.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 8px 22px -10px rgb(0 0 0 / 0.45);
}
.sidebar .btn-ghost { color: rgb(255 255 255 / 0.8); }
.sidebar .btn-ghost:hover { background: rgb(255 255 255 / 0.12); color: #fff; box-shadow: none; }
.sidebar .add-btn { background: #fff; color: var(--navy); box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.5); }
.sidebar .add-btn:hover { background: var(--coral-50); }
.nav-count { background: var(--sky); color: #fff; }
.nav-link.is-active .nav-count { background: var(--navy); }

/* Category chips in the new family. */
.cat-google_reviews { background: #fff4dc; color: #8a5a00; }
.cat-staff_pay { background: #e3f1ec; color: #1f6650; }
.cat-office { background: var(--coral-50); color: var(--navy); }
.cat-subscription { background: #ece9f8; color: #4b3f8f; }
.cat-backlinks { background: #e1eef8; color: #11669b; }
.tile-teal { background: #e8f4f2; }
.tile-amber { background: #fff7e6; }

/* ============================================================ icons == */

.ico { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-link .ico { transition: transform 260ms cubic-bezier(.3, 1.6, .5, 1); }
.nav-link:hover .ico { transform: translateY(-1px) rotate(-8deg) scale(1.12); }
.nav-link.is-active .ico { color: var(--sky); }

/* Tile icon badge: lifts, and the coin flips, when you point at the tile. */
.tile { position: relative; transition: transform 200ms ease, box-shadow 200ms ease; overflow: hidden; }
a.tile:hover, .tile.is-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-raised); }
.tile.is-link { cursor: pointer; }
.tile-ico {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--coral-50);
  color: var(--sky);
  transition: transform 450ms cubic-bezier(.3, 1.5, .5, 1);
}
.tile-ico .ico { width: 20px; height: 20px; }
.tile:hover .tile-ico { transform: rotateY(180deg) scale(1.08); }
.tile-accent .tile-ico { background: rgb(255 255 255 / 0.16); color: #fff; }
.tile-label, .tile-value { padding-right: 44px; }
.tile-value { white-space: nowrap; }

/* A soft pulse on the "still to pay" badge so pending money is noticed. */
.tile-coral-soft { background: #fff; box-shadow: var(--shadow-card), inset 0 0 0 2px var(--coral-100); }
.tile-coral-soft .tile-value { color: var(--navy); }
.tile-coral-soft .tile-ico { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 78% { transform: rotate(-12deg); } 86% { transform: rotate(10deg); } 94% { transform: rotate(-4deg); } }

/* Money confetti from the add buttons. */
.coin-pop {
  position: fixed;
  pointer-events: none;
  z-index: 80;
  font: 700 13px var(--font-mono);
  color: var(--sky);
  animation: coin 900ms ease-out forwards;
}
@keyframes coin { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), -70px) scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  .tile, .tile-ico, .nav-link .ico, .coin-pop, .tile-coral-soft .tile-ico { transition: none !important; animation: none !important; }
}
@media (max-width: 900px) {
  .sidebar { background: var(--navy); }
}

/* Backlinks table: article title sits under the website. */
.bl-cell { padding-top: 8px !important; padding-bottom: 8px !important; min-width: 220px; }
.bl-cell strong { display: block; color: var(--ink); }
.bl-cell a { display: inline-flex; align-items: center; gap: 5px; }
.bl-cell a .ico { width: 13px; height: 13px; }
.bl-title { display: block; font-size: 12px; color: var(--ink-muted); line-height: 1.35; margin-top: 2px; }

/* Overview: next month's subscriptions. */
.next-total { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--coral-50); margin-bottom: 12px; }
.next-total .tile-ico { position: static; flex: 0 0 38px; background: #fff; }
.next-total:hover .tile-ico { transform: rotate(180deg); }
.next-sum { font: 700 22px var(--font-mono); color: var(--navy); letter-spacing: -0.02em; }
.next-sum .cur { font-size: 12px; color: var(--ink-faint); }
.next-list { display: flex; flex-direction: column; }
.next-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--warm-100); }
.next-row:first-child { border-top: 0; }
.next-row .grow strong { display: block; font-size: 13px; color: var(--ink); }
.next-date { width: 42px; flex: 0 0 42px; text-align: center; border-radius: 10px; background: var(--navy); color: #fff; padding: 4px 0; line-height: 1.05; }
.next-date strong { display: block; font: 700 16px var(--font-mono); }
.next-date span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
.next-amt { font: 600 13px var(--font-mono); color: var(--ink); white-space: nowrap; }

/* Category bars line up: fixed-width value column. */
.bars-cat .bar-row { grid-template-columns: minmax(84px, 34%) 1fr 128px; }
.bars-cat .bar-value { text-align: right; }

/* Partner-site house mark as the logo. */
.brand-logo { background: none !important; padding: 0; object-fit: contain; box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.45) !important; border-radius: 9px; }
.brand-logo-lg { width: 52px; height: 52px; flex-basis: 52px; border-radius: 13px; }
