:root {
  /* TGSRTC Brand Colors - Red, Gold, White/Grey */
  --brand-red: #c62828;
  --brand-red-dark: #8e0000;
  --brand-gold: #fbc02d;
  --brand-gold-light: #fff263;
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #212121;
  --text-muted: #616161;
  --border-color: #e0e0e0;
  --success: #2e7d32;
  --info: #0277bd;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 64px;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
}

/* Navigation */
.nav {
  background-color: var(--brand-red);
  color: white;
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Layout */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  height: fit-content;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-item {
  margin-bottom: var(--space-xs);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text-main);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

.sidebar-link:hover {
  background: var(--bg-main);
}

.sidebar-link.active {
  background: var(--brand-red);
  color: white;
}

/* Cards & Sections */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--brand-red-dark);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.input {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
}

.input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.1);
}

/* Profile Photo */
.profile-photo-section {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.placeholder-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-red);
  flex-shrink: 0;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-red);
  color: white;
}

.btn-primary:hover {
  background: var(--brand-red-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
}

.btn-outline:hover {
  background: rgba(198, 40, 40, 0.05);
}

/* Wallet & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  text-align: center;
  border-bottom: 4px solid var(--brand-gold);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-red-dark);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-info { background: #e3f2fd; color: #0277bd; }

/* Family Members List */
.family-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.family-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.family-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Footer */
footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0;
  background: #212121;
  color: white;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--brand-gold);
}
