:root {
  --navy: #1a2e4a;
  --navy-light: #2a4068;
  --gold: #c8a84b;
  --gold-light: #e0c068;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #dde2ea;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-light); text-decoration: underline; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.sidebar-nav .nav-section {
  padding: 16px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.sidebar-footer a { color: rgba(255,255,255,0.6); }
.sidebar-footer a:hover { color: #fff; }

.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title { font-size: 17px; font-weight: 600; }

.topbar-user { font-size: 13px; color: var(--text-muted); }

.page-body { padding: 32px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-input, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--navy);
}

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfc; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-admin { background: #e8f0fb; color: var(--navy); }
.badge-member { background: #f0f0f0; color: var(--text-muted); }
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #fee2e2; color: #dc2626; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}
.login-box {
  background: var(--surface);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}
.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dashboard home grid */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.dash-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: box-shadow 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.dash-tile:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  text-decoration: none;
  color: var(--text);
}
.dash-tile-icon { font-size: 36px; margin-bottom: 12px; }
.dash-tile-label { font-size: 14px; font-weight: 600; }
.dash-tile-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; height: auto; }
  .main-content { margin-left: 0; }
  .app-layout { flex-direction: column; }
  .page-body { padding: 16px; }
}

/* Opportunity status badges */
.badge-draft { background: #e9ecef; color: #495057; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #842029; }

/* Sidebar nav badge (pending count) */
.nav-badge {
  display: inline-block;
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Alert warning */
.alert-warning { background: #fff3cd; border-left-color: #ffc107; color: #856404; }

/* Form textarea */
textarea.form-input { resize: vertical; font-family: inherit; }
