:root {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #38bdf8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  text-decoration: none;
}
.badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}
.badge-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.badge-treasurer {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-secretary {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.badge-member {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

@media (min-width: 860px) {
  .desktop-nav {
    display: flex !important;
  }
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
  width: 100%;
}

/* Alert / Flash */
.flash-alert {
  padding: 0.85rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.flash-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: #6ee7b7;
}
.flash-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
}
.flash-info {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid var(--primary);
  color: #7dd3fc;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}
.card-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Stat Box */
.stat-box {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.25rem;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: #38bdf8;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: 0.375rem;
  font-size: 1rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}
.btn-secondary {
  background: #475569;
  color: white;
}
.btn-secondary:hover {
  background: #334155;
  text-decoration: none;
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: #0f172a;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* PWA Install Banner */
.install-banner {
  display: none;
  background: #0369a1;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.install-banner.active {
  display: flex;
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: auto;
}
