* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Nunito', sans-serif; background: #F5F0E8; color: #2D3436; padding: 2rem; }
h1 { color: #5BA4A4; margin-bottom: 1rem; }
h2 { color: #5BA4A4; margin-bottom: 0.5rem; font-size: 1.2rem; }
input, select, textarea {
  padding: 0.5rem;
  margin: 0.25rem 0;
  border: 1px solid #B2BEC3;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}
input { width: 300px; }
select { min-width: 140px; }
textarea { width: 100%; font-family: inherit; resize: vertical; }
button {
  padding: 0.5rem 1rem;
  background: #5BA4A4;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
button:hover { background: #4a8f8f; }
button:disabled { background: #B2BEC3; cursor: not-allowed; }
.error { color: #E8836B; margin-top: 0.5rem; }
.placeholder-msg { color: #636e72; font-style: italic; margin: 1rem 0; }

/* Header */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }

/* Role badge */
.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-badge.L1 { background: #dfe6e9; color: #636e72; }
.role-badge.L2 { background: #81ecec; color: #00635a; }
.role-badge.superadmin { background: #fab1a0; color: #6c2315; }

/* Tab navigation */
#main-nav {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #dfe6e9;
}
.nav-tab {
  background: transparent;
  color: #636e72;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-tab:hover { color: #5BA4A4; background: transparent; }
.nav-tab.active {
  color: #5BA4A4;
  border-bottom-color: #5BA4A4;
  background: transparent;
}

/* Sections */
.section { padding: 1rem 0; }

/* Search / filter bars */
.search-bar, .filter-bar, .agent-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

/* Results area */
.results-area { margin-top: 1rem; }

/* Tables */
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.results-table th {
  background: #5BA4A4;
  color: #fff;
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.results-table td {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0ede6;
}
.results-table tr:nth-child(even) td { background: #faf8f4; }
.results-table tr:hover td { background: #eef9f9; }
.results-table .action-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* Detail panel */
.detail-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dfe6e9;
}
.detail-panel h3 { color: #5BA4A4; margin-bottom: 0.5rem; font-size: 1rem; }

/* Sub-tabs inside detail panels */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #dfe6e9;
  margin-bottom: 1rem;
}
.sub-tab {
  background: transparent;
  color: #636e72;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: -1px;
}
.sub-tab:hover { color: #5BA4A4; background: transparent; }
.sub-tab.active { color: #5BA4A4; border-bottom-color: #5BA4A4; background: transparent; }

/* Load more button */
.load-more-btn {
  display: block;
  margin: 1rem auto;
  background: transparent;
  color: #5BA4A4;
  border: 1px solid #5BA4A4;
}
.load-more-btn:hover { background: #eef9f9; }

/* Button variants */
.btn-secondary {
  background: #dfe6e9;
  color: #2D3436;
}
.btn-secondary:hover { background: #b2bec3; }
.btn-danger { background: #E8836B; }
.btn-danger:hover { background: #d6705a; }
.btn-warning { background: #fdcb6e; color: #2D3436; }
.btn-warning:hover { background: #f0b837; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-active { background: #55efc4; color: #00635a; }
.status-trial { background: #ffeaa7; color: #6c5300; }
.status-expired { background: #fab1a0; color: #6c2315; }

/* Confirmation modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-content h3 { color: #2D3436; margin-bottom: 0.5rem; }
.modal-content p { color: #636e72; margin-bottom: 1rem; font-size: 0.9rem; }
.modal-content label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.85rem; }
.modal-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Info rows in detail panels */
.info-row { display: flex; gap: 1rem; margin-bottom: 0.4rem; font-size: 0.9rem; }
.info-label { font-weight: 600; min-width: 140px; color: #636e72; }

/* Loading spinner */
.loading-text { color: #636e72; font-style: italic; }
.error-text { color: #E8836B; }

/* Login form layout */
#login-section { max-width: 360px; margin: 4rem auto; text-align: center; }
#login-form { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
