/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: rgba(158, 158, 185, 0.2);
  color: rgba(40, 40, 70, 0.9);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ─── Header ────────────────────────────────────────────────── */
.main-header {
  /* background: #ffffff; */
  background: rgba(40, 40, 70, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 2rem;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
}



.logo img {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  /* color: #1a202c; */
  color: white;
  letter-spacing: -0.3px;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  transition: all 0.3s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.nav-links a:hover {
   background: rgba(40, 40, 70, 0.9);
}

.nav-links li:last-child a {
  padding: 0.4rem 1rem;
}

/* ─── Form Container (Login / Register) ─────────────────────── */
.form-container {
  max-width: 420px;
  margin: 5rem auto 2rem;
  padding: 2.5rem 2rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.form-container h1 {
  margin: 0 0 1.75rem;
  font-size: 1.6rem;
  /* color: #1a202c; */
  font-weight: 700;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f8fafc;
  /* color: #1a202c; */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  background: rgba(40, 40, 70, 0.9);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

.btn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  margin-top: 1.25rem;
  background: rgba(40, 40, 70, 0.9);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn:hover  { background: rgba(21, 21, 49, 0.9); }
.btn:active { transform: scale(0.98); }

.form-container > p {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #718096;
}

.form-container > p a {
  color: rgba(40, 40, 70, 0.9);
  font-weight: 500;
}

.form-container > p a:hover { text-decoration: underline; }

/* ─── Error / Alert Banner ───────────────────────────────────── */
.error-message {
  background: #fff5f5;
  color: #c53030;
  padding: 0.75rem 1rem;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  text-align: left;
}

.success-message {
  background: #f0fff4;
  color: #276749;
  padding: 0.75rem 1rem;
  border: 1px solid #9ae6b4;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  text-align: left;
}

/* ─── Page Layout ───────────────────────────────────────────── */
.page-container {
  padding: 0 1.5rem;
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.6rem;
  color: rgba(40, 40, 70, 0.9);
}

/* ─── Button variants ───────────────────────────────────────── */
.btn-sm {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  width: auto;
  margin-top: 0;
}

.btn-outline {
  background: transparent;
  padding: 0.4rem 0.9rem;
  color: rgba(40, 40, 70, 0.9);
  border: 1.5px solid rgba(40, 40, 70, 0.9);
}

.btn-outline:hover {
  background: #eff6ff;
}

/* ─── Data Table ────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #f2f7fd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.data-table thead {
  /* background: #f8fafc; */
  background: #a8c0d7;
}

.data-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(40, 40, 70, 0.9);
  border-bottom: 1px solid #e2e8f0;
}

.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  color: #2d3748;
  border-bottom: 1px solid white; 
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #e7f3ff; }

.data-table td:last-child { text-align: right; }

/* ─── Role Badge ────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.role-admin   { background: #69bf8c; color: #ffffff; }
.role-standard { background: #56b4f3; color: #ffffff; }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { 
  display: flex;
  align-items: flex-start;
  padding-top: 8rem;
 }

.modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  width: 460px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  /* color: #1a202c; */
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #718096;
  line-height: 1;
  padding: 0;
}

.modal-close:hover { color: #1a202c; }

/* ─── App Access Section (Edit User modal) ───────────────────── */
.app-access-section {
  border-top: 1.5px solid #e2e8f0;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
}

.app-access-header {
  font-weight: 600;
  font-size: 0.9rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.app-access-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  cursor: pointer;
}

.app-access-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: rgba(40, 40, 70, 0.9);
  cursor: pointer;
}

.app-access-loading {
  color: #718096;
  font-size: 0.9rem;
}

.app-access-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.app-access-admin-note {
  font-size: 0.875rem;
  color: #718096;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.modal .form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f8fafc;
  /* color: #1a202c; */
  appearance: none;
}

.modal .form-group select:focus {
  outline: none;
  border-color: rgba(40, 40, 70, 0.9);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
