/* ============================================================
   Square Insurance Analytics — Shared Stylesheet
   Theme: Financial Dark — Navy · Gold · Precision
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --navy-950:  #060d1a;
  --navy-900:  #0a1628;
  --navy-800:  #0f2040;
  --navy-700:  #162a55;
  --navy-600:  #1e3a6e;
  --navy-500:  #274d8f;
  --gold-500:  #c9a84c;
  --gold-400:  #e0be6e;
  --gold-300:  #f0d898;
  --gold-200:  #f8edc6;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --white:     #ffffff;
  --success:   #22c55e;
  --danger:    #ef4444;
  --info:      #38bdf8;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-gold: 0 0 0 1px rgba(201, 168, 76, 0.2), 0 4px 24px rgba(201, 168, 76, 0.08);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.4), 0 12px 40px rgba(0,0,0,0.3);
  --transition:  all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  background-color: var(--navy-950);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(38,77,143,0.25) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='g' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0 60L60 0M-15 15L15-15M45 75L75 45' stroke='rgba(255,255,255,0.025)' stroke-width='1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23g)'/%3E%3C/svg%3E");
  color: var(--slate-300);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Page Load Animation ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
  50%       { box-shadow: 0 0 0 6px rgba(201,168,76,0.12); }
}
@keyframes rowReveal {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(201,168,76,0.3); }
  50%       { border-color: rgba(201,168,76,0.7); }
}

/* ── Navbar ── */
.navbar.navbar-default {
  background: rgba(10, 22, 40, 0.92) !important;
  border: none !important;
  border-bottom: 1px solid rgba(201,168,76,0.2) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 !important;
  margin-bottom: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5) !important;
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: fadeIn 0.5s ease both;
}

.navbar-default .navbar-nav > li > a {
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--slate-400) !important;
  padding: 18px 16px !important;
  transition: var(--transition) !important;
  position: relative;
  white-space: nowrap;
}

.navbar-default .navbar-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  border-radius: 2px 2px 0 0;
  transition: var(--transition);
}

.navbar-default .navbar-nav > li > a:hover {
  color: var(--gold-400) !important;
  background: rgba(201,168,76,0.06) !important;
}

.navbar-default .navbar-nav > li > a:hover::after {
  left: 12%; right: 12%;
}

.navbar-default .navbar-nav > li.active > a,
.navbar-default .navbar-nav > li.active > a:hover,
.navbar-default .navbar-nav > li.active > a:focus {
  color: var(--gold-400) !important;
  background: rgba(201,168,76,0.1) !important;
  font-weight: 600 !important;
}

.navbar-default .navbar-nav > li.active > a::after {
  left: 0; right: 0;
}

/* Brand logo area */
.navbar-brand-area {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-right: 1px solid rgba(201,168,76,0.15);
  margin-right: 8px;
}

/* ── Page Container ── */
.container {
  max-width: 1400px !important;
  padding: 40px 32px !important;
  animation: fadeSlideIn 0.6s ease 0.1s both;
}

/* ── Page Header ── */
.page-header-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  animation: fadeSlideIn 0.6s ease 0.15s both;
}

.page-title {
  font-family: var(--font-display) !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  color: var(--white) !important;
  letter-spacing: -0.01em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--white) 0%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 !important;
}

.page-title span {
  display: block;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-500);
  -webkit-text-fill-color: var(--gold-500);
  margin-bottom: 4px;
}

.last-updated {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  color: var(--slate-400) !important;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 14px;
  border-radius: 99px;
  white-space: nowrap;
  float: none !important;
}

.last-updated::before {
  content: '⬤ ';
  color: var(--success);
  font-size: 7px;
  vertical-align: middle;
  margin-right: 4px;
}

/* ── Table Card Wrapper ── */
.table-card {
  background: var(--navy-900);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: fadeSlideIn 0.6s ease 0.25s both;
}

/* ── Tables ── */
.table-card .table {
  margin: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
}

.table-card .table > thead > tr > th {
  font-family: var(--font-body) !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--gold-500) !important;
  background: var(--navy-800) !important;
  border: none !important;
  border-bottom: 1px solid rgba(201,168,76,0.2) !important;
  padding: 14px 16px !important;
  white-space: nowrap;
}

.table-card .table > thead > tr > th:first-child {
  border-left: 3px solid var(--gold-500) !important;
  padding-left: 20px !important;
}

.table-card .table > tbody > tr {
  transition: var(--transition);
  animation: rowReveal 0.4s ease both;
}

.table-card .table > tbody > tr:nth-child(1)  { animation-delay: 0.30s; }
.table-card .table > tbody > tr:nth-child(2)  { animation-delay: 0.35s; }
.table-card .table > tbody > tr:nth-child(3)  { animation-delay: 0.40s; }
.table-card .table > tbody > tr:nth-child(4)  { animation-delay: 0.45s; }
.table-card .table > tbody > tr:nth-child(5)  { animation-delay: 0.50s; }
.table-card .table > tbody > tr:nth-child(6)  { animation-delay: 0.55s; }
.table-card .table > tbody > tr:nth-child(7)  { animation-delay: 0.60s; }
.table-card .table > tbody > tr:nth-child(8)  { animation-delay: 0.65s; }
.table-card .table > tbody > tr:nth-child(9)  { animation-delay: 0.70s; }
.table-card .table > tbody > tr:nth-child(10) { animation-delay: 0.75s; }
.table-card .table > tbody > tr:nth-child(11) { animation-delay: 0.80s; }
.table-card .table > tbody > tr:nth-child(12) { animation-delay: 0.85s; }

.table-card .table > tbody > tr > td {
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  color: var(--slate-300) !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  padding: 13px 16px !important;
  transition: var(--transition);
}

.table-card .table > tbody > tr > td:first-child {
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--white) !important;
  border-left: 3px solid transparent !important;
  padding-left: 20px !important;
  letter-spacing: 0.02em;
}

.table-card .table > tbody > tr:hover > td {
  background: rgba(201,168,76,0.06) !important;
  color: var(--white) !important;
}

.table-card .table > tbody > tr:hover > td:first-child {
  border-left-color: var(--gold-500) !important;
  color: var(--gold-300) !important;
}

.table-card .table > tbody > tr:last-child > td {
  border-bottom: none !important;
}

/* ── Accordion (NOP Detailed) ── */
.panel-group {
  clear: both;
  animation: fadeSlideIn 0.6s ease 0.25s both;
}

.panel-group .panel {
  background: var(--navy-900) !important;
  border: 1px solid rgba(201,168,76,0.12) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-card) !important;
  margin-bottom: 10px !important;
  overflow: hidden;
  transition: var(--transition);
}

.panel-group .panel:hover {
  border-color: rgba(201,168,76,0.3) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.15) !important;
}

.panel-default > .panel-heading {
  padding: 0 !important;
  background: var(--navy-800) !important;
  border: none !important;
  border-bottom: 1px solid rgba(201,168,76,0.1) !important;
}

.panel-title { font-size: 14px !important; }

.panel-title > a {
  display: block;
  padding: 16px 20px !important;
  text-decoration: none !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-300) !important;
  transition: var(--transition);
}

.panel-title > a:hover,
.panel-title > a[aria-expanded="true"] {
  color: var(--gold-400) !important;
}

.more-less {
  float: right;
  color: var(--gold-500) !important;
  transition: var(--transition);
  font-size: 12px !important;
}

.panel-body {
  background: var(--navy-900) !important;
  padding: 20px !important;
}

/* Advisor count badge */
.advisor-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-400) !important;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 6px 16px;
  border-radius: 99px;
  margin-bottom: 16px !important;
  float: none !important;
}

/* Inner mini-table for month counts */
.table-card .table td table {
  min-width: 120px;
}
.table-card .table td table tr td {
  font-size: 11px !important;
  padding: 2px 6px !important;
  border: none !important;
  color: var(--slate-400) !important;
}
.table-card .table td table tr td:first-child {
  color: var(--gold-500) !important;
  font-weight: 600;
  border-left: none !important;
}
.table-card .table tr:hover td table tr td:first-child {
  border-left: none !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.55); }

/* ── Responsive ── */
@media (max-width: 992px) {
  .page-header-block { flex-direction: column; align-items: flex-start; gap: 12px; }
  .container { padding: 24px 16px !important; }
  .page-title { font-size: 24px !important; }
}

@media (max-width: 768px) {
  .navbar-default .navbar-nav > li > a { font-size: 11px !important; padding: 14px 10px !important; }
  .table-card { overflow-x: auto; }
}

/* ── Utility overrides ── */
.table-hover > tbody > tr:hover { background: transparent !important; } /* we handle hover ourselves */
.table-bordered { border: none !important; }
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td { border: none !important; }
