@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --navy:       #0f172a;
  --navy-mid:   #1e293b;
  --navy-light: #334155;
  --gold:       #c9a84c;
  --gold-light: #e8c96a;
  --gold-pale:  #fdf6e3;
  --slate:      #64748b;
  --slate-light:#f1f5f9;
  --white:      #ffffff;
  --green:      #16a34a;
  --red:        #dc2626;
  --amber:      #d97706;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(15,23,42,0.08);
  --shadow-md:  0 4px 24px rgba(15,23,42,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: #f8f9fb;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Merriweather', serif;
  line-height: 1.3;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Topbar ── */
.topbar {
  background: var(--navy);
  color: #94a3b8;
  font-size: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #1e293b;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar a { color: #94a3b8; }
.topbar a:hover { color: var(--gold); }
.topbar .status-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: #22c55e; margin-right: 5px;
}

/* ── Header / Nav ── */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(15,23,42,0.07);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Merriweather', serif;
}
.logo-icon {
  width: 36px; height: 36px; background: var(--navy);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; fill: var(--gold); }
.logo-name { font-size: 18px; font-weight: 700; color: var(--navy); }
.logo-name span { color: var(--gold); }

.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  padding: 6px 14px; border-radius: 6px; font-size: 14px; font-weight: 500;
  color: var(--navy-light); transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active { background: var(--gold-pale); color: var(--navy); }

.nav-actions { display: flex; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; border: none; }
.btn-outline { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: var(--red); color: white; }

/* ── Page hero ── */
.page-hero {
  background: var(--navy);
  color: white;
  padding: 48px 0 40px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 40px,
    rgba(201,168,76,0.04) 40px, rgba(201,168,76,0.04) 41px
  );
}
.page-hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; }
.page-hero h1 { font-size: 28px; color: white; margin-bottom: 6px; }
.page-hero p { color: #94a3b8; font-size: 15px; }
.page-hero .breadcrumb { font-size: 12px; color: #64748b; margin-bottom: 12px; }
.page-hero .breadcrumb a { color: var(--gold); }
.page-hero .breadcrumb span { margin: 0 6px; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-body { padding: 40px 0; }
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.two-col-left { min-width: 0; }

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid #e2e8f0; padding: 28px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card-title {
  font-family: 'Merriweather', serif; font-size: 16px;
  font-weight: 700; margin-bottom: 18px; color: var(--navy);
  padding-bottom: 12px; border-bottom: 1px solid #e2e8f0;
}

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid #e2e8f0; padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; color: var(--slate); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin: 6px 0 4px; font-family: 'Merriweather', serif; }
.stat-card .meta { font-size: 12px; color: var(--slate); }
.stat-card.gold { border-top: 3px solid var(--gold); }
.stat-card.green { border-top: 3px solid var(--green); }
.stat-card.amber { border-top: 3px solid var(--amber); }
.stat-card.red { border-top: 3px solid var(--red); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead tr { background: var(--navy); color: white; }
.data-table thead th { padding: 11px 16px; text-align: left; font-weight: 600; font-size: 13px; }
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.15s; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tbody td { padding: 12px 16px; }
.data-table tbody td.journal-title { font-weight: 600; color: var(--navy); }
.data-table tbody td.journal-title a { color: var(--navy); }
.data-table tbody td.journal-title a:hover { color: var(--gold); }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-amber  { background: #fef9c3; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gold   { background: var(--gold-pale); color: #92400e; border: 1px solid var(--gold); }

/* ── Score bar ── */
.score-bar-wrap { display: flex; align-items: center; gap: 10px; }
.score-bar { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.score-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 3px; }
.score-val { font-weight: 700; font-size: 14px; color: var(--navy); min-width: 50px; text-align: right; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--navy-light); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 13px; border: 1.5px solid #cbd5e1;
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  background: white; color: var(--navy); transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.12); }
.form-control[readonly] { background: var(--slate-light); cursor: default; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid #e2e8f0; margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px; background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--slate); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s; font-family: inherit;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Sidebar ── */
.sidebar-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid #e2e8f0; padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.sidebar-card h4 { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.sidebar-card p, .sidebar-card li { font-size: 13px; color: var(--slate); }
.sidebar-card ul { list-style: none; space-y: 6px; }
.sidebar-card ul li { padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.sidebar-card.gold-card { border-left: 3px solid var(--gold); background: var(--gold-pale); }
.sidebar-card.gold-card h4 { color: #92400e; }

/* ── Flash / Alert ── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fee2e2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background: #dbeafe; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-warning { background: #fef9c3; border: 1px solid #fde68a; color: #92400e; }

/* ── Search bar ── */
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; padding: 12px 48px 12px 16px;
  border: 2px solid #e2e8f0; border-radius: var(--radius);
  font-size: 15px; font-family: inherit; transition: border-color 0.2s;
}
.search-wrap input:focus { outline: none; border-color: var(--gold); }
.search-wrap .search-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--slate); pointer-events: none;
}
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: white; border: 1.5px solid #e2e8f0; border-radius: var(--radius);
  box-shadow: var(--shadow-md); z-index: 50; display: none; max-height: 320px; overflow-y: auto;
}
.search-dropdown.open { display: block; }
.search-result-item {
  padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--gold-pale); }
.search-result-item .title { font-weight: 600; font-size: 14px; }
.search-result-item .meta { font-size: 12px; color: var(--slate); }

/* ── Footer ── */
.site-footer {
  background: var(--navy); color: #94a3b8;
  padding: 48px 0 24px; margin-top: 64px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo-name { font-size: 20px; color: white; }
.footer-brand p { font-size: 13px; margin-top: 10px; color: #64748b; line-height: 1.7; }
.footer-col h5 { color: white; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: #64748b; margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; display: flex; justify-content: space-between; font-size: 12px; color: #475569; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.page-btn {
  padding: 6px 13px; border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-size: 13px; cursor: pointer; background: white; color: var(--navy);
  transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
