:root {
  --white: #ffffff;
  --light-grey: #f5f5f5;
  --light-blue: #3b82f6;
  --dark-grey: #4b5563;
  --black: #111827;
  --red: #ef4444;
  --green: #22c55e;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--light-grey);
  color: var(--black);
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
}

.logo-text { font-weight: 700; font-size: 1.25rem; color: var(--black); }

/* Simple logo mark: greyscale box + blue accent */
.brand-mark {
  display: block;
}
.brand-mark .box { stroke: var(--dark-grey); }
.brand-mark .seam { stroke: var(--dark-grey); opacity: 0.9; }
.brand-mark .accent { fill: var(--light-blue); opacity: 0.95; }
.brand-mark .label { fill: var(--black); font-weight: 700; font-family: 'Inter', sans-serif; }

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.nav-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--dark-grey);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

/* Allow anchor links to visually match the tab buttons */
.nav-tab.nav-link {
  display: inline-flex;
  align-items: center;
}
.nav-tab.nav-link:visited {
  color: var(--dark-grey);
}

.nav-tab:hover { background: var(--light-grey); }
.nav-tab.active { background: var(--black); color: var(--white); }

.user-info { display: flex; align-items: center; gap: 1rem; }
.user-email { font-size: 0.875rem; color: var(--dark-grey); }
.admin-badge {
  background: var(--light-blue);
  color: var(--white);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.logout-btn {
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: var(--dark-grey);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-btn:hover { background: var(--light-grey); border-color: var(--dark-grey); }

/* Main Content */
.main { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.welcome { margin-bottom: 2rem; }
.welcome h1 { font-size: 1.75rem; font-weight: 700; color: var(--black); margin-bottom: 0.5rem; }
.welcome p { color: var(--dark-grey); font-size: 1rem; }

/* Section Grid */
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

.section-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.section-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-icon {
  width: 40px;
  height: 40px;
  background: var(--dark-grey);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.section-title { font-size: 1.125rem; font-weight: 600; color: var(--black); }
.section-content { padding: 1rem 1.5rem; }

.link-list { list-style: none; }
.link-list li { border-bottom: 1px solid #f3f4f6; }
.link-list li:last-child { border-bottom: none; }

.link-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0;
  color: var(--dark-grey);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s ease;
}

.link-list a:hover { color: var(--light-blue); }
.link-list a svg { width: 18px; height: 18px; color: var(--dark-grey); opacity: 0.6; }
.link-list a:hover svg { color: var(--light-blue); opacity: 1; }

/* Login Screen */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-grey);
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.login-card h1 { font-size: 1.5rem; font-weight: 700; color: var(--black); margin-bottom: 0.5rem; }
.login-card .subtitle { color: var(--dark-grey); font-size: 0.9375rem; margin-bottom: 2rem; }

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--light-blue);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.login-btn:hover { background: #2563eb; }
.login-btn svg { width: 20px; height: 20px; }
.login-link {
  display: inline-block;
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--dark-grey);
  text-decoration: underline;
}
.login-link:hover { color: var(--light-blue); }
.login-footer { margin-top: 1.5rem; font-size: 0.8125rem; color: var(--dark-grey); }

/* Dashboard & Admin */
.dashboard-container { display: none; }
.page-content { display: none; }
.page-content.active { display: block; }

/* Admin Panel */
.admin-panel { background: var(--white); border-radius: 12px; border: 1px solid #e5e7eb; }

.admin-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h2 { font-size: 1.25rem; font-weight: 600; }

.btn {
  padding: 0.625rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--light-blue); color: var(--white); }
.btn-primary:hover { background: #2563eb; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--light-grey); color: var(--dark-grey); border: 1px solid #e5e7eb; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* User Table */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th, .user-table td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid #e5e7eb; }
.user-table th { font-size: 0.75rem; font-weight: 600; color: var(--dark-grey); text-transform: uppercase; letter-spacing: 0.05em; background: var(--light-grey); }
.user-table td { font-size: 0.875rem; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: #fafafa; }

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-confirmed { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-admin { background: #dbeafe; color: #1e40af; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.modal h3 { font-size: 1.25rem; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--dark-grey); }

.form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9375rem;
}

.form-group input:focus { outline: none; border-color: var(--light-blue); }

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input { width: 16px; height: 16px; }

.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.modal-actions .btn { flex: 1; }

/* Loading */
.loading { display: none; min-height: 100vh; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 3px solid #e5e7eb; border-top-color: var(--dark-grey); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.table-loading { text-align: center; padding: 3rem; color: var(--dark-grey); }
.inline-note { font-size: 0.8125rem; color: var(--dark-grey); }
.panel { background: var(--white); border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; }
.panel-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.panel-header h2 { font-size: 1.125rem; font-weight: 600; }
.panel-body { padding: 1rem 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.field label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--dark-grey); margin-bottom: 0.35rem; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  background: var(--white);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--light-blue); }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--light-grey); color: var(--dark-grey); }
.pill.blue { background: #dbeafe; color: #1e40af; }
.pill.green { background: #dcfce7; color: #166534; }
.pill.red { background: #fee2e2; color: #991b1b; }
.pill.amber { background: #fef3c7; color: #92400e; }
.muted { color: var(--dark-grey); }
.muted-strong { font-weight: 600; }
.font-semibold { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row-space-between { justify-content: space-between; }
.divider-line { height: 1px; background: #e5e7eb; margin: 0.75rem 0; }
.request-card { padding: 1rem; border-radius: 10px; }

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 1rem; flex-wrap: wrap; gap: 1rem; }
  .main { padding: 1rem; }
  .user-email { display: none; }
  .nav-tabs { width: 100%; justify-content: center; }
  .user-table { font-size: 0.8rem; }
  .user-table th, .user-table td { padding: 0.75rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}


