/* frontend/css/admin.css */

/* ======================= */
/* USER MANAGEMENT HEADER  */
/* ======================= */

#user-management-card .header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#admin-only-controls {
  display: flex;
  gap: 0.5rem;
  margin-right: 0.5rem;
}

/* Normalize ALL header buttons (prevents height/baseline drift) */
#user-management-card .header-actions button {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  white-space: nowrap;
}

/* Neutral pill (Expand / Collapse / Refresh) */
.btn-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-neutral:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Soft primary (Create Temp User) */
.btn-primary-soft {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.btn-primary-soft:hover {
  background: rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
}

/* Invite User: FORCE alignment + make BLUE */
#btn-invite {
  height: 36px;
  padding: 0 18px;
  font-weight: 600;

  /* alignment fix */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;

  /* blue styling */
  background: rgba(59, 130, 246, 0.95) !important;
  border: 1px solid rgba(59, 130, 246, 0.95) !important;
  color: white !important;
}

#btn-invite:hover {
  background: rgba(59, 130, 246, 1) !important;
  border-color: rgba(59, 130, 246, 1) !important;
}


/* ======================= */
/* GRID SYSTEM FIXES       */
/* ======================= */

@media (min-width: 1024px) {
  .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
  }

  .span-12 { grid-column: span 12; }
  .span-6  { grid-column: span 6; }
  .span-4  { grid-column: span 4; }
}

/* Mobile fallback */
@media (max-width: 1023px) {
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .span-12,
  .span-6,
  .span-4 {
    width: 100%;
  }
}


/* ======================= */
/* TABLES                  */
/* ======================= */

.table-container {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
  min-width: 600px;
}

.user-table th {
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.user-table tr:last-child td {
  border-bottom: none;
}


/* ======================= */
/* BADGES                  */
/* ======================= */

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  display: inline-block;
}

.badge-admin {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.badge-temp {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}


/* ======================= */
/* FORMS & INPUTS          */
/* ======================= */

textarea,
select,
input.input-dark {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.form-row select {
  flex: 1;
}

.form-row button {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}


/* ======================= */
/* HEADER ACTIONS (LEGACY) */
/* ======================= */

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  margin-top: 0;
}


/* ======================= */
/* TREE + SCROLLBAR        */
/* ======================= */

.table-container::-webkit-scrollbar {
  width: 8px;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

.tree-toggle {
  margin-right: 6px;
  cursor: pointer;
  color: var(--gold);
  font-family: monospace;
}

.temp-child-row.hidden {
  display: none !important;
}


/* ======================= */
/* SMALL INPUTS            */
/* ======================= */

.theme-input-sm {
  width: 80px !important;
  padding: 0.4rem !important;
  text-align: center;
  color: var(--gold);
}


/* ======================= */
/* DANGER BUTTONS (END/KICK) */
/* ======================= */

.btn-pill.danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: rgba(239, 68, 68, 1);
}

.btn-pill.danger:hover {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.65);
}


/* ======================= */
/* RESULT / INFO BOXES     */
/* ======================= */

.result-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.credential-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.5rem;
}

.credential-row:last-of-type {
  border-bottom: none;
}

.highlight {
  color: var(--gold);
  font-family: monospace;
  font-size: 1.1rem;
}

.warning-text {
  margin: 0.5rem 0 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

#user-management-card .header-actions #btn-invite {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  align-self: center !important;
  height: 36px !important;
  line-height: 1 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
