/* ==========================================================================
   mXbyte — Admin Console & Team Provisioning Styling
   ========================================================================== */

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

body.admin-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #000000;
  color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Ambient Glow
   -------------------------------------------------------------------------- */
.admin-ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.admin-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
}

.orb-top {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #ef4444 0%, transparent 70%);
  top: -150px;
  left: 15%;
}

.orb-bottom {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: -200px;
  right: 15%;
}

.admin-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 90%);
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.admin-navbar {
  background: rgba(8, 8, 14, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 0;
}

.admin-nav-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo {
  height: 30px;
  width: auto;
  display: block;
}

.admin-badge, .ceo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.pulse-gold {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.9);
}

.pulse-red {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.btn-export-data {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-export-data:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #06b6d4;
  color: #38bdf8;
}

.ceo-greeting-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.dot-sep {
  color: #64748b;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pill-btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pill-btn-nav:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.btn-signout {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-signout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.admin-main {
  flex: 1;
  position: relative;
  z-index: 10;
  padding: 2.5rem 0 5rem 0;
}

.admin-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.admin-title {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.admin-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 720px;
  line-height: 1.5;
}

.admin-sub strong {
  color: #38bdf8;
}

.btn-create-employee {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  background: #ffffff;
  color: #000000;
  border: none;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.25);
}

.btn-create-employee:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.35);
}

/* --------------------------------------------------------------------------
   Stats Grid
   -------------------------------------------------------------------------- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(160deg, rgba(22, 22, 34, 0.85), rgba(12, 12, 20, 0.95));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  font-family: 'JetBrains Mono', monospace;
}

.stat-lbl {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.2rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Table Card
   -------------------------------------------------------------------------- */
.admin-table-card {
  background: linear-gradient(160deg, rgba(20, 20, 32, 0.85), rgba(10, 10, 18, 0.95));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.table-header-flex {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.search-wrap {
  width: 100%;
  max-width: 320px;
}

.search-input {
  width: 100%;
  height: 40px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 1.25rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #06b6d4;
  background: rgba(255, 255, 255, 0.07);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.employees-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.employees-table th {
  padding: 1rem 1.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.employees-table td {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  font-size: 0.88rem;
}

.employees-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* User column cell */
.emp-cell-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.emp-avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.emp-name-text {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.92rem;
}

.emp-email-text {
  font-size: 0.76rem;
  color: #94a3b8;
}

.username-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.pass-preview-box {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.copy-mini-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.8rem;
}

.copy-mini-btn:hover {
  color: #ffffff;
}

.role-tag-dept {
  display: flex;
  flex-direction: column;
}

.role-tag-title {
  color: #ffffff;
  font-weight: 600;
}

.role-tag-dept-name {
  font-size: 0.76rem;
  color: #94a3b8;
}

.access-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
}

.status-pill-active {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-table-action {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-delete-emp {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-delete-emp:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: #11111c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  position: relative;
  transform: scale(0.96);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-head {
  margin-bottom: 1.75rem;
}

.modal-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.modal-sub {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.45;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
}

.form-input, .form-select {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.04);
  padding: 0 1.1rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  border-color: #06b6d4;
  background-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.pass-input-box {
  display: flex;
  gap: 0.5rem;
}

.btn-generate-pass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: 12px;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-generate-pass:hover {
  background: rgba(255, 255, 255, 0.15);
}

.field-error {
  color: #f87171;
  font-size: 0.78rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-cancel {
  padding: 0.7rem 1.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit-employee {
  padding: 0.7rem 1.6rem;
  border-radius: 9999px;
  background: #ffffff;
  color: #000000;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit-employee:hover {
  background: #e2e8f0;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-toast {
  background: #11111c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.9rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .admin-header-row { flex-direction: column; align-items: flex-start; }
}
