/* ========== GLOBAL DEFAULT STYLES ========== */

:root {
  --primary: #0057b8;
  --accent: #00a3e0;
  --bg: #f8f9fa;
  --text: #222;
  --radius: 10px;
  --max-width: 900px;
  /* Shared tokens moved from page files */
  --muted: #6b7280;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
}

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

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 80px; /* space below fixed header */
}

/* ===== HEADER / NAVBAR ===== */
header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.navbar {
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* Logo + tagline */
.logo-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.7rem;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.tagline {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* ===== NAVIGATION GROUP (links + account) ===== */
.nav-right {
  display: flex;
  align-items: center;
  gap: 96px; /* ~1 inch of space between links and account icon */
}

/* Navigation links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: 0.35rem 0.25rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== ACCOUNT CONTROLS ===== */
.account-controls {
  position: relative;
}

.account-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.account-icon:hover {
  border-color: var(--primary);
}

.account-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dropdown */
.account-menu {
  position: absolute;
  right: 0;
  top: 48px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 0.5rem 0;
  width: 190px;
  list-style: none;
  display: none;
  z-index: 10;
}

.account-menu.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

.account-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
}

.account-menu a:hover {
  background: #f5f5f5;
}

.account-menu .logout a {
  color: #d93025;
  font-weight: 600;
}

.account-menu .logout a:hover {
  background: #ffeaea;
}

/* Fade animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: var(--max-width);
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ===== FOOTER ===== */
footer {
  background: #f1f3f5;
  margin-top: 3rem;
  border-top: 1px solid #ddd;
  font-size: 0.95rem;
  color: #333;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

.footer-column h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column li {
  margin: 0.4rem 0;
}

.footer-column a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-column a:hover {
  color: var(--accent);
}

.footer-bottom {
  background: white;
  text-align: center;
  padding: 1rem;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
  color: #555;
}

/* ===== UTILITIES (moved from page files) ===== */
.subtle { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: #f7f7f7; }
/* Support both modifier syntaxes */
.btn--primary, .btn.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--primary:hover, .btn.btn--primary:hover { filter: brightness(0.95); }
.btn--link, .btn.btn--link {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding-left: 0;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Tables */
.table-wrap { overflow-x: auto; }
.txn-table { width: 100%; border-collapse: collapse; }
.txn-table th, .txn-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #f1f3f5;
  white-space: nowrap;
}
.txn-table thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}
.txn-table .num { text-align: right; }
.txn-table tbody tr:hover { background: #fafafa; }

/* Accessibility helper */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0;
}

/* ===== SMALL SCREENS ===== */
@media (max-width: 640px) {
  .tagline { white-space: normal; }
  .nav-links { gap: 0.6rem; }
  .logo-group { flex-direction: column; align-items: flex-start; }
  .nav-right { gap: 40px; } /* reduced spacing on small screens */
}
